async_openai_wasm::types::realtime

Enum ClientEvent

Source
pub enum ClientEvent {
    SessionUpdate(SessionUpdateEvent),
    InputAudioBufferAppend(InputAudioBufferAppendEvent),
    InputAudioBufferCommit(InputAudioBufferCommitEvent),
    InputAudioBufferClear(InputAudioBufferClearEvent),
    ConversationItemCreate(ConversationItemCreateEvent),
    ConversationItemTruncate(ConversationItemTruncateEvent),
    ConversationItemDelete(ConversationItemDeleteEvent),
    ResponseCreate(ResponseCreateEvent),
    ResponseCancel(ResponseCancelEvent),
}
Available on crate feature realtime only.
Expand description

These are events that the OpenAI Realtime WebSocket server will accept from the client.

Variants§

§

SessionUpdate(SessionUpdateEvent)

Send this event to update the session’s default configuration.

§

InputAudioBufferAppend(InputAudioBufferAppendEvent)

Send this event to append audio bytes to the input audio buffer.

§

InputAudioBufferCommit(InputAudioBufferCommitEvent)

Send this event to commit audio bytes to a user message.

§

InputAudioBufferClear(InputAudioBufferClearEvent)

Send this event to clear the audio bytes in the buffer.

§

ConversationItemCreate(ConversationItemCreateEvent)

Send this event when adding an item to the conversation.

§

ConversationItemTruncate(ConversationItemTruncateEvent)

Send this event when you want to truncate a previous assistant message’s audio.

§

ConversationItemDelete(ConversationItemDeleteEvent)

Send this event when you want to remove any item from the conversation history.

§

ResponseCreate(ResponseCreateEvent)

Send this event to trigger a response generation.

§

ResponseCancel(ResponseCancelEvent)

Send this event to cancel an in-progress response.

Trait Implementations§

Source§

impl Debug for ClientEvent

Source§

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

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

impl<'de> Deserialize<'de> for ClientEvent

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 From<ConversationItemCreateEvent> for ClientEvent

Source§

fn from(value: ConversationItemCreateEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ConversationItemDeleteEvent> for ClientEvent

Source§

fn from(value: ConversationItemDeleteEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ConversationItemTruncateEvent> for ClientEvent

Source§

fn from(value: ConversationItemTruncateEvent) -> Self

Converts to this type from the input type.
Source§

impl From<InputAudioBufferAppendEvent> for ClientEvent

Source§

fn from(value: InputAudioBufferAppendEvent) -> Self

Converts to this type from the input type.
Source§

impl From<InputAudioBufferClearEvent> for ClientEvent

Source§

fn from(value: InputAudioBufferClearEvent) -> Self

Converts to this type from the input type.
Source§

impl From<InputAudioBufferCommitEvent> for ClientEvent

Source§

fn from(value: InputAudioBufferCommitEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ResponseCancelEvent> for ClientEvent

Source§

fn from(value: ResponseCancelEvent) -> Self

Converts to this type from the input type.
Source§

impl From<ResponseCreateEvent> for ClientEvent

Source§

fn from(value: ResponseCreateEvent) -> Self

Converts to this type from the input type.
Source§

impl From<SessionUpdateEvent> for ClientEvent

Source§

fn from(value: SessionUpdateEvent) -> Self

Converts to this type from the input type.
Source§

impl Into<String> for &ClientEvent

Source§

fn into(self) -> String

Converts this type into the (usually inferred) input type.
Source§

impl Serialize for ClientEvent

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

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToText for T
where T: Into<ClientEvent>,

Source§

fn to_text(self) -> String

Available on crate feature realtime only.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
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<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<U, <U as TryFrom<T>>::Error>> + 'async_trait>>
where T: 'async_trait,

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T