Skip to main content

RealtimeServerEvent

Enum RealtimeServerEvent 

Source
#[non_exhaustive]
pub enum RealtimeServerEvent {
Show 23 variants SessionCreated { session_id: Option<String>, raw: JsonValue, }, SessionUpdated { raw: JsonValue, }, SpeechStarted { item_id: Option<String>, raw: JsonValue, }, SpeechStopped { item_id: Option<String>, raw: JsonValue, }, AudioCommitted { item_id: Option<String>, previous_item_id: Option<String>, raw: JsonValue, }, ConversationItemAdded { item_id: String, item: JsonValue, raw: JsonValue, }, InputTranscriptionCompleted { item_id: String, transcript: String, raw: JsonValue, }, ResponseCreated { response_id: String, raw: JsonValue, }, ResponseDone { response_id: String, status: String, raw: JsonValue, }, OutputItemAdded { response_id: String, item_id: String, raw: JsonValue, }, OutputItemDone { response_id: String, item_id: String, raw: JsonValue, }, ContentPartAdded { response_id: String, item_id: String, raw: JsonValue, }, ContentPartDone { response_id: String, item_id: String, raw: JsonValue, }, AudioDelta { response_id: String, item_id: String, delta: Bytes, raw: JsonValue, }, AudioDone { response_id: String, item_id: String, raw: JsonValue, }, AudioTranscriptDelta { response_id: String, item_id: String, delta: String, raw: JsonValue, }, AudioTranscriptDone { response_id: String, item_id: String, transcript: Option<String>, raw: JsonValue, }, TextDelta { response_id: String, item_id: String, delta: String, raw: JsonValue, }, TextDone { response_id: String, item_id: String, text: Option<String>, raw: JsonValue, }, FunctionCallArgumentsDelta { response_id: String, item_id: String, call_id: String, delta: String, raw: JsonValue, }, FunctionCallArgumentsDone { response_id: String, item_id: String, call_id: String, name: String, arguments: String, raw: JsonValue, }, Error { message: String, code: Option<String>, raw: JsonValue, }, Custom { raw_type: String, raw: JsonValue, },
}
Expand description

Events received from the server, tagged by type.

Every variant carries the raw provider message in raw.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SessionCreated

Session created.

Fields

§session_id: Option<String>

Session id.

§raw: JsonValue

Raw message.

§

SessionUpdated

Session updated.

Fields

§raw: JsonValue

Raw message.

§

SpeechStarted

Speech started.

Fields

§item_id: Option<String>

Item id.

§raw: JsonValue

Raw message.

§

SpeechStopped

Speech stopped.

Fields

§item_id: Option<String>

Item id.

§raw: JsonValue

Raw message.

§

AudioCommitted

Input audio committed.

Fields

§item_id: Option<String>

Item id.

§previous_item_id: Option<String>

Previous item id.

§raw: JsonValue

Raw message.

§

ConversationItemAdded

Conversation item added.

Fields

§item_id: String

Item id.

§item: JsonValue

The item.

§raw: JsonValue

Raw message.

§

InputTranscriptionCompleted

Input transcription completed.

Fields

§item_id: String

Item id.

§transcript: String

Transcript.

§raw: JsonValue

Raw message.

§

ResponseCreated

Response created.

Fields

§response_id: String

Response id.

§raw: JsonValue

Raw message.

§

ResponseDone

Response done.

Fields

§response_id: String

Response id.

§status: String

Status.

§raw: JsonValue

Raw message.

§

OutputItemAdded

Output item added.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§raw: JsonValue

Raw message.

§

OutputItemDone

Output item done.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§raw: JsonValue

Raw message.

§

ContentPartAdded

Content part added.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§raw: JsonValue

Raw message.

§

ContentPartDone

Content part done.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§raw: JsonValue

Raw message.

§

AudioDelta

Audio increment.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§delta: Bytes

Audio bytes.

§raw: JsonValue

Raw message.

§

AudioDone

Audio done.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§raw: JsonValue

Raw message.

§

AudioTranscriptDelta

Audio transcript increment.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§delta: String

Text.

§raw: JsonValue

Raw message.

§

AudioTranscriptDone

Audio transcript done.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§transcript: Option<String>

Full transcript.

§raw: JsonValue

Raw message.

§

TextDelta

Text increment.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§delta: String

Text.

§raw: JsonValue

Raw message.

§

TextDone

Text done.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§text: Option<String>

Full text.

§raw: JsonValue

Raw message.

§

FunctionCallArgumentsDelta

Function call arguments increment.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§call_id: String

Call id.

§delta: String

Arguments text.

§raw: JsonValue

Raw message.

§

FunctionCallArgumentsDone

Function call arguments done.

Fields

§response_id: String

Response id.

§item_id: String

Item id.

§call_id: String

Call id.

§name: String

Function name.

§arguments: String

Complete arguments JSON text.

§raw: JsonValue

Raw message.

§

Error

Error.

Fields

§message: String

Message.

§code: Option<String>

Code.

§raw: JsonValue

Raw message.

§

Custom

A provider event without a standardized mapping.

Fields

§raw_type: String

Provider event type.

§raw: JsonValue

Raw message.

Trait Implementations§

Source§

impl Clone for RealtimeServerEvent

Source§

fn clone(&self) -> RealtimeServerEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RealtimeServerEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RealtimeServerEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RealtimeServerEvent

Source§

fn eq(&self, other: &RealtimeServerEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for RealtimeServerEvent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RealtimeServerEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.