RealtimeEvent class sealed
A Realtime API event.
- Implementers
- RealtimeEventClose
- RealtimeEventConversationCreated
- RealtimeEventConversationInterrupted
- RealtimeEventConversationItemAppended
- RealtimeEventConversationItemCompleted
- RealtimeEventConversationItemCreate
- RealtimeEventConversationItemCreated
- RealtimeEventConversationItemDelete
- RealtimeEventConversationItemDeleted
- RealtimeEventConversationItemInputAudioTranscriptionCompleted
- RealtimeEventConversationItemInputAudioTranscriptionDelta
- RealtimeEventConversationItemInputAudioTranscriptionFailed
- RealtimeEventConversationItemTruncate
- RealtimeEventConversationItemTruncated
- RealtimeEventConversationUpdated
- RealtimeEventError
- RealtimeEventGeneric
- RealtimeEventInputAudioBufferAppend
- RealtimeEventInputAudioBufferClear
- RealtimeEventInputAudioBufferCleared
- RealtimeEventInputAudioBufferCommit
- RealtimeEventInputAudioBufferCommitted
- RealtimeEventInputAudioBufferSpeechStarted
- RealtimeEventInputAudioBufferSpeechStopped
- RealtimeEventRateLimitsUpdated
- RealtimeEventResponseAudioDelta
- RealtimeEventResponseAudioDone
- RealtimeEventResponseAudioTranscriptDelta
- RealtimeEventResponseAudioTranscriptDone
- RealtimeEventResponseCancel
- RealtimeEventResponseContentPartAdded
- RealtimeEventResponseContentPartDone
- RealtimeEventResponseCreate
- RealtimeEventResponseCreated
- RealtimeEventResponseDone
- RealtimeEventResponseFunctionCallArgumentsDelta
- RealtimeEventResponseFunctionCallArgumentsDone
- RealtimeEventResponseOutputItemAdded
- RealtimeEventResponseOutputItemDone
- RealtimeEventResponseTextDelta
- RealtimeEventResponseTextDone
- RealtimeEventSessionCreated
- RealtimeEventSessionUpdate
- RealtimeEventSessionUpdated
- Annotations
-
- @Freezed(unionKey: 'type', unionValueCase: FreezedUnionCase.snake)
Constructors
- RealtimeEvent.close({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.close) RealtimeEventType type, required bool error})
-
The websocket connection was closed.
constfactory
- RealtimeEvent.conversationCreated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationCreated) RealtimeEventType type, required Conversation conversation})
-
Returned when a conversation is created. Emitted right after session creation.
constfactory
- RealtimeEvent.conversationInterrupted({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationInterrupted) RealtimeEventType type})
-
The conversation was interrupted.
constfactory
- RealtimeEvent.conversationItemAppended({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemAppended) RealtimeEventType type, required FormattedItem item})
-
An item was appended to the conversation.
constfactory
- RealtimeEvent.conversationItemCompleted({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemCompleted) RealtimeEventType type, required FormattedItem item})
-
An item was completed.
constfactory
- RealtimeEvent.conversationItemCreate({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemCreate) RealtimeEventType type, @JsonKey(name: 'previous_item_id', includeIfNull: false) String? previousItemId, required Item item})
-
Add a new Item to the Conversation's context, including messages, function calls, and function call
responses. This event can be used both to populate a "history" of the conversation and to add new
items mid-stream, but has the current limitation that it cannot populate assistant audio messages.
constfactory
- RealtimeEvent.conversationItemCreated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemCreated) RealtimeEventType type, @JsonKey(name: 'previous_item_id', includeIfNull: false) String? previousItemId, required Item item})
-
Returned when a conversation item is created. There are several scenarios that produce this event:
constfactory
- RealtimeEvent.conversationItemDelete({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemDelete) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId})
-
Send this event when you want to remove any item from the conversation history. The server will
respond with a
conversation.item.deleted
event, unless the item does not exist in the conversation history, in which case the server will respond with an error.constfactory - RealtimeEvent.conversationItemDeleted({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemDeleted) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId})
-
Returned when an item in the conversation is deleted by the client with a
conversation.item.delete
event. This event is used to synchronize the server's understanding of the conversation history with the client's view.constfactory - RealtimeEvent.conversationItemInputAudioTranscriptionCompleted({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemInputAudioTranscriptionCompleted) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'content_index') required int contentIndex, required String transcript})
-
This event is the output of audio transcription for user audio written to the user audio buffer.
Transcription begins when the input audio buffer is committed by the client or server (in
server_vad
mode). Transcription runs asynchronously with Response creation, so this event may come before or after the Response events.constfactory - RealtimeEvent.conversationItemInputAudioTranscriptionDelta({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemInputAudioTranscriptionDelta) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'content_index', includeIfNull: false) int? contentIndex, @JsonKey(includeIfNull: false) String? delta})
-
Returned when the text value of an input audio transcription content part is updated.
constfactory
- RealtimeEvent.conversationItemInputAudioTranscriptionFailed({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemInputAudioTranscriptionFailed) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'content_index') required int contentIndex, required TranscriptionError error})
-
Returned when input audio transcription is configured, and a transcription request for a user message
failed. These events are separate from other
error
events so that the client can identify the related Item.constfactory - RealtimeEvent.conversationItemTruncate({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemTruncate) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'content_index') required int contentIndex, @JsonKey(name: 'audio_end_ms') required int audioEndMs})
-
Send this event to truncate a previous assistant message's audio. The server will produce audio faster
than realtime, so this event is useful when the user interrupts to truncate audio that has already
been sent to the client but not yet played. This will synchronize the server's understanding of the
audio with the client's playback.
constfactory
- RealtimeEvent.conversationItemTruncated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationItemTruncated) RealtimeEventType type, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'content_index') required int contentIndex, @JsonKey(name: 'audio_end_ms') required int audioEndMs})
-
Returned when an earlier assistant audio message item is truncated by the client with a
conversation.item.truncate
event. This event is used to synchronize the server's understanding of the audio with the client's playback.constfactory - RealtimeEvent.conversationUpdated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.conversationUpdated) RealtimeEventType type, required EventHandlerResult result})
-
The conversation was updated.
constfactory
- RealtimeEvent.error({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.error) RealtimeEventType type, required APIError error})
-
Returned when an error occurs, which could be a client problem or a server problem. Most errors are
recoverable and the session will stay open, we recommend to implementors to monitor and log error
messages by default.
constfactory
-
RealtimeEvent.fromJson(Map<
String, dynamic> json) -
Object construction from a JSON representation
factory
- RealtimeEvent.generic({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.realtimeEvent) RealtimeEventType type, required RealtimeEvent event})
-
A generic realtime event.
constfactory
- RealtimeEvent.inputAudioBufferAppend({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferAppend) RealtimeEventType type, required String audio})
-
Send this event to append audio bytes to the input audio buffer. The audio buffer is temporary storage
you can write to and later commit. In Server VAD mode, the audio buffer is used to detect speech and
the server will decide when to commit. When Server VAD is disabled, you must commit the audio buffer
manually.
constfactory
- RealtimeEvent.inputAudioBufferClear({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferClear) RealtimeEventType type})
-
Send this event to clear the audio bytes in the buffer. The server will respond with an
input_audio_buffer.cleared
event.constfactory - RealtimeEvent.inputAudioBufferCleared({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferCleared) RealtimeEventType type})
-
Returned when the input audio buffer is cleared by the client with a
input_audio_buffer.clear
event.constfactory - RealtimeEvent.inputAudioBufferCommit({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferCommit) RealtimeEventType type})
-
Send this event to commit the user input audio buffer, which will create a new user message item in
the conversation. This event will produce an error if the input audio buffer is empty. When in Server
VAD mode, the client does not need to send this event, the server will commit the audio buffer
automatically.
constfactory
- RealtimeEvent.inputAudioBufferCommitted({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferCommitted) RealtimeEventType type, @JsonKey(name: 'previous_item_id', includeIfNull: false) String? previousItemId, @JsonKey(name: 'item_id') required String itemId})
-
Returned when an input audio buffer is committed, either by the client or automatically in server VAD
mode. The
item_id
property is the ID of the user message item that will be created, thus aconversation.item.created
event will also be sent to the client.constfactory - RealtimeEvent.inputAudioBufferSpeechStarted({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferSpeechStarted) RealtimeEventType type, @JsonKey(name: 'audio_start_ms') required int audioStartMs, @JsonKey(name: 'item_id') required String itemId})
-
Sent by the server when in
server_vad
mode to indicate that speech has been detected in the audio buffer. This can happen any time audio is added to the buffer (unless speech is already detected). The client may want to use this event to interrupt audio playback or provide visual feedback to the user. The client should expect to receive ainput_audio_buffer.speech_stopped
event when speech stops. Theitem_id
property is the ID of the user message item that will be created when speech stops and will also be included in theinput_audio_buffer.speech_stopped
event (unless the client manually commits the audio buffer during VAD activation).constfactory - RealtimeEvent.inputAudioBufferSpeechStopped({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.inputAudioBufferSpeechStopped) RealtimeEventType type, @JsonKey(name: 'audio_end_ms') required int audioEndMs, @JsonKey(name: 'item_id') required String itemId})
-
Returned in
server_vad
mode when the server detects the end of speech in the audio buffer. The server will also send anconversation.item.created
event with the user message item that is created from the audio buffer.constfactory -
RealtimeEvent.rateLimitsUpdated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.rateLimitsUpdated) RealtimeEventType type, @JsonKey(name: 'rate_limits') required List<
RateLimit> rateLimits}) -
Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is created
some tokens will be "reserved" for the output tokens, the rate limits shown here reflect that
reservation, which is then adjusted accordingly once the Response is completed.
constfactory
- RealtimeEvent.responseAudioDelta({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseAudioDelta) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required String delta})
-
Returned when the model-generated audio is updated.
constfactory
- RealtimeEvent.responseAudioDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseAudioDone) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex})
-
Returned when the model-generated audio is done. Also emitted when a Response is interrupted, incomplete, or cancelled.
constfactory
- RealtimeEvent.responseAudioTranscriptDelta({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseAudioTranscriptDelta) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required String delta})
-
Returned when the model-generated transcription of audio output is updated.
constfactory
- RealtimeEvent.responseAudioTranscriptDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseAudioTranscriptDone) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required String transcript})
-
Returned when the model-generated transcription of audio output is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
constfactory
- RealtimeEvent.responseCancel({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseCancel) RealtimeEventType type, @JsonKey(name: 'response_id', includeIfNull: false) String? responseId})
-
Send this event to cancel an in-progress response. The server will respond with a
response.cancelled
event or an error if there is no response to cancel.constfactory - RealtimeEvent.responseContentPartAdded({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseContentPartAdded) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required ContentPart part})
-
Returned when a new content part is added to an assistant message item during response generation.
constfactory
- RealtimeEvent.responseContentPartDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseContentPartDone) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required ContentPart part})
-
Returned when a content part is done streaming in an assistant message item. Also emitted when a Response is interrupted, incomplete, or cancelled.
constfactory
- RealtimeEvent.responseCreate({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseCreate) RealtimeEventType type, @JsonKey(includeIfNull: false) ResponseConfig? response})
-
This event instructs the server to create a Response, which means triggering model inference. When in
Server VAD mode, the server will create Responses automatically.
constfactory
- RealtimeEvent.responseCreated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseCreated) RealtimeEventType type, required Response response})
-
Returned when a new Response is created. The first event of response creation, where the response is
in an initial state of
in_progress
.constfactory - RealtimeEvent.responseDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseDone) RealtimeEventType type, required Response response})
-
Returned when a Response is done streaming. Always emitted, no matter the final state. The Response
object included in the
response.done
event will include all output Items in the Response but will omit the raw audio data.constfactory - RealtimeEvent.responseFunctionCallArgumentsDelta({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseFunctionCallArgumentsDelta) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'call_id') required String callId, required String delta})
-
Returned when the model-generated function call arguments are updated.
constfactory
- RealtimeEvent.responseFunctionCallArgumentsDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseFunctionCallArgumentsDone) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'call_id') required String callId, required String arguments})
-
Returned when the model-generated function call arguments are done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
constfactory
- RealtimeEvent.responseOutputItemAdded({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseOutputItemAdded) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'output_index') required int outputIndex, required Item item})
-
Returned when a new Item is created during Response generation.
constfactory
- RealtimeEvent.responseOutputItemDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseOutputItemDone) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'output_index') required int outputIndex, required Item item})
-
Returned when an Item is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
constfactory
- RealtimeEvent.responseTextDelta({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseTextDelta) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required String delta})
-
Returned when the text value of a "text" content part is updated.
constfactory
- RealtimeEvent.responseTextDone({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.responseTextDone) RealtimeEventType type, @JsonKey(name: 'response_id') required String responseId, @JsonKey(name: 'item_id') required String itemId, @JsonKey(name: 'output_index') required int outputIndex, @JsonKey(name: 'content_index') required int contentIndex, required String text})
-
Returned when the text value of a "text" content part is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.
constfactory
- RealtimeEvent.sessionCreated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.sessionCreated) RealtimeEventType type, required Session session})
-
Returned when a Session is created. Emitted automatically when a new connection is established as the
first server event. This event will contain the default Session configuration.
constfactory
- RealtimeEvent.sessionUpdate({@JsonKey(name: 'event_id', includeIfNull: false) String? eventId, @Default(RealtimeEventType.sessionUpdate) RealtimeEventType type, required SessionConfig session})
-
Send this event to update the session's default configuration. The client may send this event at any
time to update the session configuration, and any field may be updated at any time, except for
"voice". The server will respond with a
session.updated
event that shows the full effective configuration. Only fields that are present are updated, thus the correct way to clear a field like "instructions" is to pass an empty string.constfactory - RealtimeEvent.sessionUpdated({@JsonKey(name: 'event_id') required String eventId, @Default(RealtimeEventType.sessionUpdated) RealtimeEventType type, required Session session})
-
Returned when a session is updated with a
session.update
event, unless there is an error.constfactory
Properties
-
copyWith
→ $RealtimeEventCopyWith<
RealtimeEvent> -
Create a copy of RealtimeEvent
with the given fields replaced by the non-null parameter values.
no setterinherited
- eventId → String?
-
Optional client-generated ID used to identify this event.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → RealtimeEventType
-
The type of the event.
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult conversationItemCreate(RealtimeEventConversationItemCreate value), required TResult conversationItemDelete(RealtimeEventConversationItemDelete value), required TResult conversationItemTruncate(RealtimeEventConversationItemTruncate value), required TResult inputAudioBufferAppend(RealtimeEventInputAudioBufferAppend value), required TResult inputAudioBufferClear(RealtimeEventInputAudioBufferClear value), required TResult inputAudioBufferCommit(RealtimeEventInputAudioBufferCommit value), required TResult responseCancel(RealtimeEventResponseCancel value), required TResult responseCreate(RealtimeEventResponseCreate value), required TResult sessionUpdate(RealtimeEventSessionUpdate value), required TResult conversationCreated(RealtimeEventConversationCreated value), required TResult conversationItemCreated(RealtimeEventConversationItemCreated value), required TResult conversationItemDeleted(RealtimeEventConversationItemDeleted value), required TResult conversationItemInputAudioTranscriptionCompleted(RealtimeEventConversationItemInputAudioTranscriptionCompleted value), required TResult conversationItemInputAudioTranscriptionFailed(RealtimeEventConversationItemInputAudioTranscriptionFailed value), required TResult conversationItemInputAudioTranscriptionDelta(RealtimeEventConversationItemInputAudioTranscriptionDelta value), required TResult conversationItemTruncated(RealtimeEventConversationItemTruncated value), required TResult error(RealtimeEventError value), required TResult inputAudioBufferCleared(RealtimeEventInputAudioBufferCleared value), required TResult inputAudioBufferCommitted(RealtimeEventInputAudioBufferCommitted value), required TResult inputAudioBufferSpeechStarted(RealtimeEventInputAudioBufferSpeechStarted value), required TResult inputAudioBufferSpeechStopped(RealtimeEventInputAudioBufferSpeechStopped value), required TResult rateLimitsUpdated(RealtimeEventRateLimitsUpdated value), required TResult responseAudioDelta(RealtimeEventResponseAudioDelta value), required TResult responseAudioDone(RealtimeEventResponseAudioDone value), required TResult responseAudioTranscriptDelta(RealtimeEventResponseAudioTranscriptDelta value), required TResult responseAudioTranscriptDone(RealtimeEventResponseAudioTranscriptDone value), required TResult responseContentPartAdded(RealtimeEventResponseContentPartAdded value), required TResult responseContentPartDone(RealtimeEventResponseContentPartDone value), required TResult responseCreated(RealtimeEventResponseCreated value), required TResult responseDone(RealtimeEventResponseDone value), required TResult responseFunctionCallArgumentsDelta(RealtimeEventResponseFunctionCallArgumentsDelta value), required TResult responseFunctionCallArgumentsDone(RealtimeEventResponseFunctionCallArgumentsDone value), required TResult responseOutputItemAdded(RealtimeEventResponseOutputItemAdded value), required TResult responseOutputItemDone(RealtimeEventResponseOutputItemDone value), required TResult responseTextDelta(RealtimeEventResponseTextDelta value), required TResult responseTextDone(RealtimeEventResponseTextDone value), required TResult sessionCreated(RealtimeEventSessionCreated value), required TResult sessionUpdated(RealtimeEventSessionUpdated value), required TResult close(RealtimeEventClose value), required TResult conversationInterrupted(RealtimeEventConversationInterrupted value), required TResult conversationUpdated(RealtimeEventConversationUpdated value), required TResult conversationItemAppended(RealtimeEventConversationItemAppended value), required TResult conversationItemCompleted(RealtimeEventConversationItemCompleted value), required TResult generic(RealtimeEventGeneric value)}) → TResult -
inherited
-
mapOrNull<
TResult extends Object?> ({TResult? conversationItemCreate(RealtimeEventConversationItemCreate value)?, TResult? conversationItemDelete(RealtimeEventConversationItemDelete value)?, TResult? conversationItemTruncate(RealtimeEventConversationItemTruncate value)?, TResult? inputAudioBufferAppend(RealtimeEventInputAudioBufferAppend value)?, TResult? inputAudioBufferClear(RealtimeEventInputAudioBufferClear value)?, TResult? inputAudioBufferCommit(RealtimeEventInputAudioBufferCommit value)?, TResult? responseCancel(RealtimeEventResponseCancel value)?, TResult? responseCreate(RealtimeEventResponseCreate value)?, TResult? sessionUpdate(RealtimeEventSessionUpdate value)?, TResult? conversationCreated(RealtimeEventConversationCreated value)?, TResult? conversationItemCreated(RealtimeEventConversationItemCreated value)?, TResult? conversationItemDeleted(RealtimeEventConversationItemDeleted value)?, TResult? conversationItemInputAudioTranscriptionCompleted(RealtimeEventConversationItemInputAudioTranscriptionCompleted value)?, TResult? conversationItemInputAudioTranscriptionFailed(RealtimeEventConversationItemInputAudioTranscriptionFailed value)?, TResult? conversationItemInputAudioTranscriptionDelta(RealtimeEventConversationItemInputAudioTranscriptionDelta value)?, TResult? conversationItemTruncated(RealtimeEventConversationItemTruncated value)?, TResult? error(RealtimeEventError value)?, TResult? inputAudioBufferCleared(RealtimeEventInputAudioBufferCleared value)?, TResult? inputAudioBufferCommitted(RealtimeEventInputAudioBufferCommitted value)?, TResult? inputAudioBufferSpeechStarted(RealtimeEventInputAudioBufferSpeechStarted value)?, TResult? inputAudioBufferSpeechStopped(RealtimeEventInputAudioBufferSpeechStopped value)?, TResult? rateLimitsUpdated(RealtimeEventRateLimitsUpdated value)?, TResult? responseAudioDelta(RealtimeEventResponseAudioDelta value)?, TResult? responseAudioDone(RealtimeEventResponseAudioDone value)?, TResult? responseAudioTranscriptDelta(RealtimeEventResponseAudioTranscriptDelta value)?, TResult? responseAudioTranscriptDone(RealtimeEventResponseAudioTranscriptDone value)?, TResult? responseContentPartAdded(RealtimeEventResponseContentPartAdded value)?, TResult? responseContentPartDone(RealtimeEventResponseContentPartDone value)?, TResult? responseCreated(RealtimeEventResponseCreated value)?, TResult? responseDone(RealtimeEventResponseDone value)?, TResult? responseFunctionCallArgumentsDelta(RealtimeEventResponseFunctionCallArgumentsDelta value)?, TResult? responseFunctionCallArgumentsDone(RealtimeEventResponseFunctionCallArgumentsDone value)?, TResult? responseOutputItemAdded(RealtimeEventResponseOutputItemAdded value)?, TResult? responseOutputItemDone(RealtimeEventResponseOutputItemDone value)?, TResult? responseTextDelta(RealtimeEventResponseTextDelta value)?, TResult? responseTextDone(RealtimeEventResponseTextDone value)?, TResult? sessionCreated(RealtimeEventSessionCreated value)?, TResult? sessionUpdated(RealtimeEventSessionUpdated value)?, TResult? close(RealtimeEventClose value)?, TResult? conversationInterrupted(RealtimeEventConversationInterrupted value)?, TResult? conversationUpdated(RealtimeEventConversationUpdated value)?, TResult? conversationItemAppended(RealtimeEventConversationItemAppended value)?, TResult? conversationItemCompleted(RealtimeEventConversationItemCompleted value)?, TResult? generic(RealtimeEventGeneric value)?}) → TResult? -
inherited
-
maybeMap<
TResult extends Object?> ({TResult conversationItemCreate(RealtimeEventConversationItemCreate value)?, TResult conversationItemDelete(RealtimeEventConversationItemDelete value)?, TResult conversationItemTruncate(RealtimeEventConversationItemTruncate value)?, TResult inputAudioBufferAppend(RealtimeEventInputAudioBufferAppend value)?, TResult inputAudioBufferClear(RealtimeEventInputAudioBufferClear value)?, TResult inputAudioBufferCommit(RealtimeEventInputAudioBufferCommit value)?, TResult responseCancel(RealtimeEventResponseCancel value)?, TResult responseCreate(RealtimeEventResponseCreate value)?, TResult sessionUpdate(RealtimeEventSessionUpdate value)?, TResult conversationCreated(RealtimeEventConversationCreated value)?, TResult conversationItemCreated(RealtimeEventConversationItemCreated value)?, TResult conversationItemDeleted(RealtimeEventConversationItemDeleted value)?, TResult conversationItemInputAudioTranscriptionCompleted(RealtimeEventConversationItemInputAudioTranscriptionCompleted value)?, TResult conversationItemInputAudioTranscriptionFailed(RealtimeEventConversationItemInputAudioTranscriptionFailed value)?, TResult conversationItemInputAudioTranscriptionDelta(RealtimeEventConversationItemInputAudioTranscriptionDelta value)?, TResult conversationItemTruncated(RealtimeEventConversationItemTruncated value)?, TResult error(RealtimeEventError value)?, TResult inputAudioBufferCleared(RealtimeEventInputAudioBufferCleared value)?, TResult inputAudioBufferCommitted(RealtimeEventInputAudioBufferCommitted value)?, TResult inputAudioBufferSpeechStarted(RealtimeEventInputAudioBufferSpeechStarted value)?, TResult inputAudioBufferSpeechStopped(RealtimeEventInputAudioBufferSpeechStopped value)?, TResult rateLimitsUpdated(RealtimeEventRateLimitsUpdated value)?, TResult responseAudioDelta(RealtimeEventResponseAudioDelta value)?, TResult responseAudioDone(RealtimeEventResponseAudioDone value)?, TResult responseAudioTranscriptDelta(RealtimeEventResponseAudioTranscriptDelta value)?, TResult responseAudioTranscriptDone(RealtimeEventResponseAudioTranscriptDone value)?, TResult responseContentPartAdded(RealtimeEventResponseContentPartAdded value)?, TResult responseContentPartDone(RealtimeEventResponseContentPartDone value)?, TResult responseCreated(RealtimeEventResponseCreated value)?, TResult responseDone(RealtimeEventResponseDone value)?, TResult responseFunctionCallArgumentsDelta(RealtimeEventResponseFunctionCallArgumentsDelta value)?, TResult responseFunctionCallArgumentsDone(RealtimeEventResponseFunctionCallArgumentsDone value)?, TResult responseOutputItemAdded(RealtimeEventResponseOutputItemAdded value)?, TResult responseOutputItemDone(RealtimeEventResponseOutputItemDone value)?, TResult responseTextDelta(RealtimeEventResponseTextDelta value)?, TResult responseTextDone(RealtimeEventResponseTextDone value)?, TResult sessionCreated(RealtimeEventSessionCreated value)?, TResult sessionUpdated(RealtimeEventSessionUpdated value)?, TResult close(RealtimeEventClose value)?, TResult conversationInterrupted(RealtimeEventConversationInterrupted value)?, TResult conversationUpdated(RealtimeEventConversationUpdated value)?, TResult conversationItemAppended(RealtimeEventConversationItemAppended value)?, TResult conversationItemCompleted(RealtimeEventConversationItemCompleted value)?, TResult generic(RealtimeEventGeneric value)?, required TResult orElse()}) → TResult -
inherited
-
maybeWhen<
TResult extends Object?> ({TResult conversationItemCreate(String eventId, RealtimeEventType type, String? previousItemId, Item item)?, TResult conversationItemDelete(String eventId, RealtimeEventType type, String itemId)?, TResult conversationItemTruncate(String eventId, RealtimeEventType type, String itemId, int contentIndex, int audioEndMs)?, TResult inputAudioBufferAppend(String eventId, RealtimeEventType type, String audio)?, TResult inputAudioBufferClear(String eventId, RealtimeEventType type)?, TResult inputAudioBufferCommit(String eventId, RealtimeEventType type)?, TResult responseCancel(String eventId, RealtimeEventType type, String? responseId)?, TResult responseCreate(String eventId, RealtimeEventType type, ResponseConfig? response)?, TResult sessionUpdate(String? eventId, RealtimeEventType type, SessionConfig session)?, TResult conversationCreated(String eventId, RealtimeEventType type, Conversation conversation)?, TResult conversationItemCreated(String eventId, RealtimeEventType type, String? previousItemId, Item item)?, TResult conversationItemDeleted(String eventId, RealtimeEventType type, String itemId)?, TResult conversationItemInputAudioTranscriptionCompleted(String eventId, RealtimeEventType type, String itemId, int contentIndex, String transcript)?, TResult conversationItemInputAudioTranscriptionFailed(String eventId, RealtimeEventType type, String itemId, int contentIndex, TranscriptionError error)?, TResult conversationItemInputAudioTranscriptionDelta(String eventId, RealtimeEventType type, String itemId, int? contentIndex, String? delta)?, TResult conversationItemTruncated(String eventId, RealtimeEventType type, String itemId, int contentIndex, int audioEndMs)?, TResult error(String eventId, RealtimeEventType type, APIError error)?, TResult inputAudioBufferCleared(String eventId, RealtimeEventType type)?, TResult inputAudioBufferCommitted(String eventId, RealtimeEventType type, String? previousItemId, String itemId)?, TResult inputAudioBufferSpeechStarted(String eventId, RealtimeEventType type, int audioStartMs, String itemId)?, TResult inputAudioBufferSpeechStopped(String eventId, RealtimeEventType type, int audioEndMs, String itemId)?, TResult rateLimitsUpdated(String eventId, RealtimeEventType type, List< RateLimit> rateLimits)?, TResult responseAudioDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta)?, TResult responseAudioDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex)?, TResult responseAudioTranscriptDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta)?, TResult responseAudioTranscriptDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String transcript)?, TResult responseContentPartAdded(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, ContentPart part)?, TResult responseContentPartDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, ContentPart part)?, TResult responseCreated(String eventId, RealtimeEventType type, Response response)?, TResult responseDone(String eventId, RealtimeEventType type, Response response)?, TResult responseFunctionCallArgumentsDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, String callId, String delta)?, TResult responseFunctionCallArgumentsDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, String callId, String arguments)?, TResult responseOutputItemAdded(String eventId, RealtimeEventType type, String responseId, int outputIndex, Item item)?, TResult responseOutputItemDone(String eventId, RealtimeEventType type, String responseId, int outputIndex, Item item)?, TResult responseTextDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta)?, TResult responseTextDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String text)?, TResult sessionCreated(String eventId, RealtimeEventType type, Session session)?, TResult sessionUpdated(String eventId, RealtimeEventType type, Session session)?, TResult close(String eventId, RealtimeEventType type, bool error)?, TResult conversationInterrupted(String eventId, RealtimeEventType type)?, TResult conversationUpdated(String eventId, RealtimeEventType type, EventHandlerResult result)?, TResult conversationItemAppended(String eventId, RealtimeEventType type, FormattedItem item)?, TResult conversationItemCompleted(String eventId, RealtimeEventType type, FormattedItem item)?, TResult generic(String eventId, RealtimeEventType type, RealtimeEvent event)?, required TResult orElse()}) → TResult -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this RealtimeEvent to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult conversationItemCreate(String eventId, RealtimeEventType type, String? previousItemId, Item item), required TResult conversationItemDelete(String eventId, RealtimeEventType type, String itemId), required TResult conversationItemTruncate(String eventId, RealtimeEventType type, String itemId, int contentIndex, int audioEndMs), required TResult inputAudioBufferAppend(String eventId, RealtimeEventType type, String audio), required TResult inputAudioBufferClear(String eventId, RealtimeEventType type), required TResult inputAudioBufferCommit(String eventId, RealtimeEventType type), required TResult responseCancel(String eventId, RealtimeEventType type, String? responseId), required TResult responseCreate(String eventId, RealtimeEventType type, ResponseConfig? response), required TResult sessionUpdate(String? eventId, RealtimeEventType type, SessionConfig session), required TResult conversationCreated(String eventId, RealtimeEventType type, Conversation conversation), required TResult conversationItemCreated(String eventId, RealtimeEventType type, String? previousItemId, Item item), required TResult conversationItemDeleted(String eventId, RealtimeEventType type, String itemId), required TResult conversationItemInputAudioTranscriptionCompleted(String eventId, RealtimeEventType type, String itemId, int contentIndex, String transcript), required TResult conversationItemInputAudioTranscriptionFailed(String eventId, RealtimeEventType type, String itemId, int contentIndex, TranscriptionError error), required TResult conversationItemInputAudioTranscriptionDelta(String eventId, RealtimeEventType type, String itemId, int? contentIndex, String? delta), required TResult conversationItemTruncated(String eventId, RealtimeEventType type, String itemId, int contentIndex, int audioEndMs), required TResult error(String eventId, RealtimeEventType type, APIError error), required TResult inputAudioBufferCleared(String eventId, RealtimeEventType type), required TResult inputAudioBufferCommitted(String eventId, RealtimeEventType type, String? previousItemId, String itemId), required TResult inputAudioBufferSpeechStarted(String eventId, RealtimeEventType type, int audioStartMs, String itemId), required TResult inputAudioBufferSpeechStopped(String eventId, RealtimeEventType type, int audioEndMs, String itemId), required TResult rateLimitsUpdated(String eventId, RealtimeEventType type, List< RateLimit> rateLimits), required TResult responseAudioDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta), required TResult responseAudioDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex), required TResult responseAudioTranscriptDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta), required TResult responseAudioTranscriptDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String transcript), required TResult responseContentPartAdded(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, ContentPart part), required TResult responseContentPartDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, ContentPart part), required TResult responseCreated(String eventId, RealtimeEventType type, Response response), required TResult responseDone(String eventId, RealtimeEventType type, Response response), required TResult responseFunctionCallArgumentsDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, String callId, String delta), required TResult responseFunctionCallArgumentsDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, String callId, String arguments), required TResult responseOutputItemAdded(String eventId, RealtimeEventType type, String responseId, int outputIndex, Item item), required TResult responseOutputItemDone(String eventId, RealtimeEventType type, String responseId, int outputIndex, Item item), required TResult responseTextDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta), required TResult responseTextDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String text), required TResult sessionCreated(String eventId, RealtimeEventType type, Session session), required TResult sessionUpdated(String eventId, RealtimeEventType type, Session session), required TResult close(String eventId, RealtimeEventType type, bool error), required TResult conversationInterrupted(String eventId, RealtimeEventType type), required TResult conversationUpdated(String eventId, RealtimeEventType type, EventHandlerResult result), required TResult conversationItemAppended(String eventId, RealtimeEventType type, FormattedItem item), required TResult conversationItemCompleted(String eventId, RealtimeEventType type, FormattedItem item), required TResult generic(String eventId, RealtimeEventType type, RealtimeEvent event)}) → TResult -
inherited
-
whenOrNull<
TResult extends Object?> ({TResult? conversationItemCreate(String eventId, RealtimeEventType type, String? previousItemId, Item item)?, TResult? conversationItemDelete(String eventId, RealtimeEventType type, String itemId)?, TResult? conversationItemTruncate(String eventId, RealtimeEventType type, String itemId, int contentIndex, int audioEndMs)?, TResult? inputAudioBufferAppend(String eventId, RealtimeEventType type, String audio)?, TResult? inputAudioBufferClear(String eventId, RealtimeEventType type)?, TResult? inputAudioBufferCommit(String eventId, RealtimeEventType type)?, TResult? responseCancel(String eventId, RealtimeEventType type, String? responseId)?, TResult? responseCreate(String eventId, RealtimeEventType type, ResponseConfig? response)?, TResult? sessionUpdate(String? eventId, RealtimeEventType type, SessionConfig session)?, TResult? conversationCreated(String eventId, RealtimeEventType type, Conversation conversation)?, TResult? conversationItemCreated(String eventId, RealtimeEventType type, String? previousItemId, Item item)?, TResult? conversationItemDeleted(String eventId, RealtimeEventType type, String itemId)?, TResult? conversationItemInputAudioTranscriptionCompleted(String eventId, RealtimeEventType type, String itemId, int contentIndex, String transcript)?, TResult? conversationItemInputAudioTranscriptionFailed(String eventId, RealtimeEventType type, String itemId, int contentIndex, TranscriptionError error)?, TResult? conversationItemInputAudioTranscriptionDelta(String eventId, RealtimeEventType type, String itemId, int? contentIndex, String? delta)?, TResult? conversationItemTruncated(String eventId, RealtimeEventType type, String itemId, int contentIndex, int audioEndMs)?, TResult? error(String eventId, RealtimeEventType type, APIError error)?, TResult? inputAudioBufferCleared(String eventId, RealtimeEventType type)?, TResult? inputAudioBufferCommitted(String eventId, RealtimeEventType type, String? previousItemId, String itemId)?, TResult? inputAudioBufferSpeechStarted(String eventId, RealtimeEventType type, int audioStartMs, String itemId)?, TResult? inputAudioBufferSpeechStopped(String eventId, RealtimeEventType type, int audioEndMs, String itemId)?, TResult? rateLimitsUpdated(String eventId, RealtimeEventType type, List< RateLimit> rateLimits)?, TResult? responseAudioDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta)?, TResult? responseAudioDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex)?, TResult? responseAudioTranscriptDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta)?, TResult? responseAudioTranscriptDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String transcript)?, TResult? responseContentPartAdded(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, ContentPart part)?, TResult? responseContentPartDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, ContentPart part)?, TResult? responseCreated(String eventId, RealtimeEventType type, Response response)?, TResult? responseDone(String eventId, RealtimeEventType type, Response response)?, TResult? responseFunctionCallArgumentsDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, String callId, String delta)?, TResult? responseFunctionCallArgumentsDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, String callId, String arguments)?, TResult? responseOutputItemAdded(String eventId, RealtimeEventType type, String responseId, int outputIndex, Item item)?, TResult? responseOutputItemDone(String eventId, RealtimeEventType type, String responseId, int outputIndex, Item item)?, TResult? responseTextDelta(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String delta)?, TResult? responseTextDone(String eventId, RealtimeEventType type, String responseId, String itemId, int outputIndex, int contentIndex, String text)?, TResult? sessionCreated(String eventId, RealtimeEventType type, Session session)?, TResult? sessionUpdated(String eventId, RealtimeEventType type, Session session)?, TResult? close(String eventId, RealtimeEventType type, bool error)?, TResult? conversationInterrupted(String eventId, RealtimeEventType type)?, TResult? conversationUpdated(String eventId, RealtimeEventType type, EventHandlerResult result)?, TResult? conversationItemAppended(String eventId, RealtimeEventType type, FormattedItem item)?, TResult? conversationItemCompleted(String eventId, RealtimeEventType type, FormattedItem item)?, TResult? generic(String eventId, RealtimeEventType type, RealtimeEvent event)?}) → TResult? -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited