API referenceSections

AssistantEvent

AssistantEvent object

One server-sent event (data: <json>) of a turn

  • type string required
    Allowed values: "text" "tool" "action" "usage" "waiting" "done" "error"
  • text string optional
  • tool AssistantToolEvent optional
  • action AssistantAction optional
  • usage object optional
    • input_tokens integer optional
    • output_tokens integer optional
    • cache_read_tokens integer optional
    • cache_write_tokens integer optional
  • code string optional
  • message string optional

Used by

POST/api/v1/tenants/{tid}/assistant/conversations/{cid}/messagesSend a message; the answer streams as server-sent events. Tools run as the caller through these same routes; changes wait for the user (event action). Errors before the stream starts are ordinary problems (ASSISTANT_RATE_LIMITED, ASSISTANT_BUSY)
POST/api/v1/tenants/{tid}/assistant/conversations/{cid}/actions/{aid}Approve or decline a change the assistant proposed. Approved, it runs as the caller through its own route, audited with via=assistant, plus assistant.action; then the answer continues as server-sent events