ai.stream.TurnMeta
Turn metadata as it arrives on the wire. Providers send stop_reason and token counts on different events; each TurnMeta carries what its event had and TurnStream folds non-null fields together (last write wins). The token counts mean what they mean in `root.events.Usage`.
Reference version
Signature
class ai.stream.TurnMetaTurn metadata as it arrives on the wire. Providers send stop_reason and
token counts on different events; each TurnMeta carries what its event had
and TurnStream folds non-null fields together (last write wins). The token
counts mean what they mean in root.events.Usage.
Source:<builtin>/ai/ns_stream/stream.bamlbytes 4280–4518
Fields
stop_reason
ai.content.StopReason | nullinput_tokens
int | nulloutput_tokens
int | nullcached_input_tokens
int | nullcache_write_input_tokens
int | nulluncached_input_tokens
int | nullreasoning_tokens
int | null