A chunk of the answer text.
A chunk of the model's reasoning. Anthropic ends each thinking block
with a reasoning_delta that has its signature (the text may be
empty), and gives a redacted thinking block as one reasoning_delta
with empty text and redacted data. The loop keeps these on the
reasoning part, and starts a new part for the reasoning after them,
so each block can be sent back unchanged.
A finished tool call, emitted only when its arguments are complete.
When the arguments are not valid JSON and could not be fixed, args is
the raw string and argsError says why. The loop then sends an error
tool result, so the model can try again.
Token counts for the turn.
The turn is over, and why.
One event of a streamed model turn.
A
tool_callis emitted only when its arguments are complete. Providers stream arguments in pieces, each in its own way; the adapter collects the pieces and parses the JSON once, so the core never sees partial arguments.