OptionalreasoningReasoning text, sent as one reasoning_delta.
OptionaltextAnswer text, sent as one text_delta.
OptionaltoolOne tool call.
OptionaltoolMore tool calls in the same turn.
OptionalusageToken counts. No usage event when not set.
OptionalstopDefaults to tool_calls when the step has tool calls, else end.
OptionalerrorThrown after the reasoning, text and tool calls, in place of usage and
done. A step with only an
error fails before the first event, like a failed HTTP request. A step
with text and an error is a stream that broke in the middle.
One model turn in a mock script. Each
stream()call plays the next step.Events come in this order:
reasoning_delta,text_delta, onetool_callper call (toolCallfirst, thentoolCalls),usage,done. A field that is not set gives no event.