pub enum ServerMessage {
SessionStarted {
session_id: String,
timestamp: String,
},
SessionEnded {
session_id: String,
timestamp: String,
},
Ready {
timestamp: String,
},
UserTranscript {
text: String,
timestamp: String,
},
Response {
text: String,
is_final: bool,
timestamp: String,
},
Audio {
data: String,
format: String,
sample_rate: u32,
timestamp: String,
},
TurnComplete {
timestamp: String,
},
Error {
code: String,
message: String,
timestamp: String,
},
ToolCall {
id: String,
name: String,
args: Value,
timestamp: String,
},
UserIdUpdated {
user_id: String,
migrated_messages: usize,
timestamp: String,
},
Interrupted {
timestamp: String,
},
Pong {
timestamp: String,
},
}Expand description
Server message types (received from server)
Variants§
SessionStarted
Session started
SessionEnded
Session ended
Ready
Ready - session is ready for audio input
UserTranscript
User transcript - user’s speech transcription
Response
Response - AI’s text response
Audio
Audio - AI’s audio response
Fields
TurnComplete
Turn complete - AI has finished its response turn
Error
Error message
ToolCall
Tool call from AI (function calling)
Fields
UserIdUpdated
User ID updated (guest-to-user migration complete)
Fields
Interrupted
Interrupted - AI response was interrupted by user speech (barge-in)
Pong
Pong response
Implementations§
Trait Implementations§
Source§impl Clone for ServerMessage
impl Clone for ServerMessage
Source§fn clone(&self) -> ServerMessage
fn clone(&self) -> ServerMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerMessage
impl Debug for ServerMessage
Source§impl<'de> Deserialize<'de> for ServerMessage
impl<'de> Deserialize<'de> for ServerMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ServerMessage
impl RefUnwindSafe for ServerMessage
impl Send for ServerMessage
impl Sync for ServerMessage
impl Unpin for ServerMessage
impl UnwindSafe for ServerMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more