pub enum ServerEvent {
Show 28 variants
Error(ErrorEvent),
SessionCreated(SessionCreatedEvent),
SessionUpdated(SessionUpdatedEvent),
ConversationCreated(ConversationCreatedEvent),
InputAudioBufferCommited(InputAudioBufferCommitedEvent),
InputAudioBufferCleared(InputAudioBufferClearedEvent),
InputAudioBufferSpeechStarted(InputAudioBufferSpeechStartedEvent),
InputAudioBufferSpeechStopped(InputAudioBufferSpeechStoppedEvent),
ConversationItemCreated(ConversationItemCreatedEvent),
ConversationItemInputAudioTranscriptionCompleted(ConversationItemInputAudioTranscriptionCompletedEvent),
ConversationItemInputAudioTranscriptionFailed(ConversationItemInputAudioTranscriptionFailedEvent),
ConversationItemTruncated(ConversationItemTruncatedEvent),
ConversationItemDeleted(ConversationItemDeletedEvent),
ResponseCreated(ResponseCreatedEvent),
ResponseDone(ResponseDoneEvent),
ResponseOutputItemAdded(ResponseOutputItemAddedEvent),
ResponseOutputItemDone(ResponseOutputItemDoneEvent),
ResponseContentPartAdded(ResponseContentPartAddedEvent),
ResponseContentPartDone(ResponseContentPartDoneEvent),
ResponseTextDelta(ResponseTextDeltaEvent),
ResponseTextDone(ResponseTextDoneEvent),
ResponseAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent),
ResponseAudioTranscriptDone(ResponseAudioTranscriptDoneEvent),
ResponseAudioDelta(ResponseAudioDeltaEvent),
ResponseAudioDone(ResponseAudioDoneEvent),
ResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent),
ResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent),
RateLimitsUpdated(RateLimitsUpdatedEvent),
}
realtime
only.Expand description
These are events emitted from the OpenAI Realtime WebSocket server to the client.
Variants§
Error(ErrorEvent)
Returned when an error occurs.
SessionCreated(SessionCreatedEvent)
Returned when a session is created. Emitted automatically when a new connection is established.
SessionUpdated(SessionUpdatedEvent)
Returned when a session is updated.
ConversationCreated(ConversationCreatedEvent)
Returned when a conversation is created. Emitted right after session creation.
InputAudioBufferCommited(InputAudioBufferCommitedEvent)
Returned when an input audio buffer is committed, either by the client or automatically in server VAD mode.
InputAudioBufferCleared(InputAudioBufferClearedEvent)
Returned when the input audio buffer is cleared by the client.
InputAudioBufferSpeechStarted(InputAudioBufferSpeechStartedEvent)
Returned in server turn detection mode when speech is detected.
InputAudioBufferSpeechStopped(InputAudioBufferSpeechStoppedEvent)
Returned in server turn detection mode when speech stops.
ConversationItemCreated(ConversationItemCreatedEvent)
Returned when a conversation item is created.
ConversationItemInputAudioTranscriptionCompleted(ConversationItemInputAudioTranscriptionCompletedEvent)
Returned when input audio transcription is enabled and a transcription succeeds.
ConversationItemInputAudioTranscriptionFailed(ConversationItemInputAudioTranscriptionFailedEvent)
Returned when input audio transcription is configured, and a transcription request for a user message failed.
ConversationItemTruncated(ConversationItemTruncatedEvent)
Returned when an earlier assistant audio message item is truncated by the client.
ConversationItemDeleted(ConversationItemDeletedEvent)
Returned when an item in the conversation is deleted.
ResponseCreated(ResponseCreatedEvent)
Returned when a new Response is created. The first event of response creation, where the response is in an initial state of “in_progress”.
ResponseDone(ResponseDoneEvent)
Returned when a Response is done streaming. Always emitted, no matter the final state.
ResponseOutputItemAdded(ResponseOutputItemAddedEvent)
Returned when a new Item is created during response generation.
ResponseOutputItemDone(ResponseOutputItemDoneEvent)
Returned when an Item is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
ResponseContentPartAdded(ResponseContentPartAddedEvent)
Returned when a new content part is added to an assistant message item during response generation.
ResponseContentPartDone(ResponseContentPartDoneEvent)
Returned when a content part is done streaming in an assistant message item. Also emitted when a Response is interrupted, incomplete, or cancelled.
ResponseTextDelta(ResponseTextDeltaEvent)
Returned when the text value of a “text” content part is updated.
ResponseTextDone(ResponseTextDoneEvent)
Returned when the text value of a “text” content part is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
ResponseAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent)
Returned when the model-generated transcription of audio output is updated.
ResponseAudioTranscriptDone(ResponseAudioTranscriptDoneEvent)
Returned when the model-generated transcription of audio output is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
ResponseAudioDelta(ResponseAudioDeltaEvent)
Returned when the model-generated audio is updated.
ResponseAudioDone(ResponseAudioDoneEvent)
Returned when the model-generated audio is done. Also emitted when a Response is interrupted, incomplete, or cancelled.
ResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent)
Returned when the model-generated function call arguments are updated.
ResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent)
Returned when the model-generated function call arguments are done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
RateLimitsUpdated(RateLimitsUpdatedEvent)
Emitted after every “response.done” event to indicate the updated rate limits.
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ServerEvent
impl RefUnwindSafe for ServerEvent
impl Send for ServerEvent
impl Sync for ServerEvent
impl Unpin 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)