Skip to main content

Module events

Module events 

Source
Expand description

What the turn reports: the NDJSON events the client reads, and the events the parsers pass between themselves on the way there.

StructsΒ§

StreamEventError

EnumsΒ§

ChatbotChatStreamEvent
StreamItem πŸ”’
One item the turn reports to the client.
TurnEvent πŸ”’
What the two body parsers β€” the tool-call round and the text answer β€” yield once a response is classified. One type shared between them rather than split further: both stream Item, while Refusal/ItemAnnounced/Messages/Suspended come only from the tool-call round and Delta/ Done only from the text answer.

FunctionsΒ§

error_event_from_error πŸ”’
The framed error event for a failed ChatbotError, detailing the Azure error when the failure came with one.
error_event_from_text πŸ”’
The framed error event for a message this code raised itself, with no underlying ChatbotError.
finished_tool_call πŸ”’
Tells the client a call it has already seen is done. Carries no tool name or arguments: the frontend reads neither, and it already has both from the event that announced the call.
ndjson_line πŸ”’
Frames one event as the NDJSON line the client reads: the wire format’s single boundary.
single_event_stream πŸ”’
A stream that carries one event and ends, for a response with no turn behind it.
stream_event_for πŸ”’
The wire event a StreamItem becomes, or None for an item that has no shape on the wire (a Message item, which is reported through the text-delta path instead).