Skip to main content

Module server_message

Module server_message 

Source
Expand description

Server → Client message types and the semantic ServerEvent enum.

A single wire message (ServerMessage) is a flat struct where multiple fields may be present simultaneously (e.g. serverContent + usageMetadata). The codec::into_events function decomposes it into a sequence of ServerEvents — the application-facing abstraction.

Structs§

ApiError
An error returned by the API.
FunctionCallRequest
A function the server wants the client to execute.
GoAway
Sent when the server is about to terminate the connection. The client should reconnect (with a session resumption handle if available).
ModalityTokenCount
ServerContent
Model output and associated metadata within a single wire message.
ServerMessage
Raw server message as received on the wire.
SessionResumptionUpdate
Periodic update with a fresh session resumption handle.
ToolCallCancellation
ToolCallMessage
Transcription
Partial audio-transcription update from the server.
UsageMetadata
Token usage statistics. Accompanies many server messages.

Enums§

ServerEvent
High-level event produced by decomposing a ServerMessage.