Skip to content

Event types ​

Completion and agent streams share model-generation events, but agent events add runtime turns, tool execution, and final run state.

Completion events ​

EventContains
text_deltaIncremental visible text.
reasoning_deltaProvider reasoning content when available.
tool_call_deltaProvisional tool name or argument fragments.
tool_callA completed model tool request.
sourceA provider-reported source.
provider_tool_callA tool executed by the provider.
message_idThe provider message identifier.
finalThe normalized completion response.
errorA provider or stream failure with optional usage.

Local tool calls in a direct completion stream are data only; they are not executed by the helper.

Agent events ​

EventContains
turn_startTurn number, current prompt, and history.
generation_startThe provider-facing normalized request and model information.
text_deltaIncremental visible assistant text.
reasoning_deltaProvider reasoning content when available.
tool_call_deltaProvisional local tool-call data.
tool_callA completed local tool request.
tool_resultTool name, call IDs, arguments, and text result.
sourceA provider-reported source.
provider_tool_callA provider-executed tool record.
agent_tool_eventA nested event from an agent used as a tool.
turn_endThe completed provider response and optional first-delta timing.
finalRun ID, output, usage, messages, and optional trace or provider artifacts.
errorThe failure and cumulative authoritative usage.

Choose what each surface receives ​

Internal operations tools may need full events. User-facing clients usually need only safe text, generic tool status, a final result, and a stable error message.

Built for Anvia.