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
impl Debug for ClientEvent
Source§impl<'de> Deserialize<'de> for ClientEvent
impl<'de> Deserialize<'de> for ClientEvent
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
Source§impl From<ConversationItemCreateEvent> for ClientEvent
impl From<ConversationItemCreateEvent> for ClientEvent
Source§fn from(value: ConversationItemCreateEvent) -> Self
fn from(value: ConversationItemCreateEvent) -> Self
Converts to this type from the input type.
Source§impl From<ConversationItemDeleteEvent> for ClientEvent
impl From<ConversationItemDeleteEvent> for ClientEvent
Source§fn from(value: ConversationItemDeleteEvent) -> Self
fn from(value: ConversationItemDeleteEvent) -> Self
Converts to this type from the input type.
Source§impl From<ConversationItemTruncateEvent> for ClientEvent
impl From<ConversationItemTruncateEvent> for ClientEvent
Source§fn from(value: ConversationItemTruncateEvent) -> Self
fn from(value: ConversationItemTruncateEvent) -> Self
Converts to this type from the input type.
Source§impl From<InputAudioBufferAppendEvent> for ClientEvent
impl From<InputAudioBufferAppendEvent> for ClientEvent
Source§fn from(value: InputAudioBufferAppendEvent) -> Self
fn from(value: InputAudioBufferAppendEvent) -> Self
Converts to this type from the input type.
Source§impl From<InputAudioBufferClearEvent> for ClientEvent
impl From<InputAudioBufferClearEvent> for ClientEvent
Source§fn from(value: InputAudioBufferClearEvent) -> Self
fn from(value: InputAudioBufferClearEvent) -> Self
Converts to this type from the input type.
Source§impl From<InputAudioBufferCommitEvent> for ClientEvent
impl From<InputAudioBufferCommitEvent> for ClientEvent
Source§fn from(value: InputAudioBufferCommitEvent) -> Self
fn from(value: InputAudioBufferCommitEvent) -> Self
Converts to this type from the input type.
Source§impl From<ResponseCancelEvent> for ClientEvent
impl From<ResponseCancelEvent> for ClientEvent
Source§fn from(value: ResponseCancelEvent) -> Self
fn from(value: ResponseCancelEvent) -> Self
Converts to this type from the input type.
Source§impl From<ResponseCreateEvent> for ClientEvent
impl From<ResponseCreateEvent> for ClientEvent
Source§fn from(value: ResponseCreateEvent) -> Self
fn from(value: ResponseCreateEvent) -> Self
Converts to this type from the input type.
Source§impl From<SessionUpdateEvent> for ClientEvent
impl From<SessionUpdateEvent> for ClientEvent
Source§fn from(value: SessionUpdateEvent) -> Self
fn from(value: SessionUpdateEvent) -> Self
Converts to this type from the input type.
Source§impl Into<String> for &ClientEvent
impl Into<String> for &ClientEvent
Auto Trait Implementations§
impl Freeze for ClientEvent
impl RefUnwindSafe for ClientEvent
impl Send for ClientEvent
impl Sync for ClientEvent
impl Unpin for ClientEvent
impl UnwindSafe for ClientEvent
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