pub enum ServerEvent {
Show 22 variants
SessionCreated {
event_id: String,
session: Value,
},
SessionUpdated {
event_id: String,
session: Value,
},
Error {
event_id: String,
error: ErrorInfo,
},
SpeechStarted {
event_id: String,
audio_start_ms: u64,
},
SpeechStopped {
event_id: String,
audio_end_ms: u64,
},
AudioCommitted {
event_id: String,
item_id: String,
},
AudioCleared {
event_id: String,
},
ItemCreated {
event_id: String,
item: Value,
},
ResponseCreated {
event_id: String,
response: Value,
},
ResponseDone {
event_id: String,
response: Value,
},
OutputItemAdded {
event_id: String,
response_id: String,
output_index: u32,
item: Value,
},
OutputItemDone {
event_id: String,
response_id: String,
output_index: u32,
item: Value,
},
AudioDelta {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
content_index: u32,
delta: Vec<u8>,
},
AudioDone {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
content_index: u32,
},
TextDelta {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
content_index: u32,
delta: String,
},
TextDone {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
content_index: u32,
text: String,
},
TranscriptDelta {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
content_index: u32,
delta: String,
},
TranscriptDone {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
content_index: u32,
transcript: String,
},
FunctionCallDelta {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
call_id: String,
delta: String,
},
FunctionCallDone {
event_id: String,
response_id: String,
item_id: String,
output_index: u32,
call_id: String,
name: String,
arguments: String,
},
RateLimitsUpdated {
event_id: String,
rate_limits: Vec<RateLimit>,
},
Unknown,
}realtime only.Expand description
Events received from the realtime server.
This is a unified event type that abstracts over provider-specific formats.
Audio data is stored as raw bytes (Vec<u8>) — decoded from base64 at the
transport boundary so consumers never need to deal with encoding.
Variants§
SessionCreated
Session was created/connected.
SessionUpdated
Session configuration was updated.
Error
Error occurred.
SpeechStarted
User speech started (VAD detected).
SpeechStopped
User speech ended (VAD detected).
AudioCommitted
Audio input buffer was committed.
AudioCleared
Audio input buffer was cleared.
ItemCreated
Conversation item was created.
ResponseCreated
Response generation started.
ResponseDone
Response generation completed.
OutputItemAdded
Response output item added.
Fields
OutputItemDone
Response output item completed.
Fields
AudioDelta
Audio delta (chunk of output audio as raw bytes).
Fields
AudioDone
Audio output completed.
Fields
TextDelta
Text delta (chunk of output text).
Fields
TextDone
Text output completed.
Fields
TranscriptDelta
Audio transcript delta.
Fields
TranscriptDone
Audio transcript completed.
Fields
FunctionCallDelta
Function call arguments delta.
Fields
FunctionCallDone
Function call completed.
Fields
RateLimitsUpdated
Rate limit information.
Unknown
Unknown event type (for forward compatibility).
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 moreSource§impl Debug for ServerEvent
impl Debug for ServerEvent
Source§impl<'de> Deserialize<'de> for ServerEvent
impl<'de> Deserialize<'de> for ServerEvent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ServerEvent
impl Serialize for ServerEvent
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ServerEvent
impl RefUnwindSafe for ServerEvent
impl Send for ServerEvent
impl Sync for ServerEvent
impl Unpin for ServerEvent
impl UnsafeUnpin for ServerEvent
impl UnwindSafe for ServerEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request