pub enum ServerEvent {
Show 15 variants
SetupComplete,
ModelText(String),
ModelAudio(Vec<u8>),
GenerationComplete,
TurnComplete,
Interrupted,
InputTranscription(String),
OutputTranscription(String),
ToolCall(Vec<FunctionCallRequest>),
ToolCallCancellation(Vec<String>),
SessionResumption {
new_handle: Option<String>,
resumable: bool,
},
GoAway {
time_left: Option<Duration>,
},
Usage(UsageMetadata),
Closed {
reason: String,
},
Error(ApiError),
}Expand description
High-level event produced by decomposing a ServerMessage.
One wire message may yield multiple events (e.g. transcription + model
text + usage stats arrive in the same JSON frame). The
codec::into_events function performs this
decomposition.
Variants§
SetupComplete
The server accepted the setup message.
ModelText(String)
A chunk of model-generated text.
ModelAudio(Vec<u8>)
A chunk of model-generated audio (base64-decoded raw PCM bytes, 24 kHz).
GenerationComplete
The model finished generating (turn may still be open for metadata).
TurnComplete
The model’s turn is fully complete.
Interrupted
The model’s generation was interrupted by user activity.
InputTranscription(String)
Transcription of the user’s spoken input.
OutputTranscription(String)
Transcription of the model’s spoken output.
ToolCall(Vec<FunctionCallRequest>)
The server requests one or more function calls.
ToolCallCancellation(Vec<String>)
The server cancels previously requested function calls.
SessionResumption
Updated session resumption state.
GoAway
The server will disconnect soon — the client should reconnect.
Usage(UsageMetadata)
Token usage statistics.
Closed
The WebSocket connection was closed.
Error(ApiError)
An API-level error.
Trait Implementations§
Source§impl Clone for ServerEvent
impl Clone for ServerEvent
Source§fn clone(&self) -> ServerEvent
fn clone(&self) -> ServerEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more