RealtimeClientEventConversationItemCreate
objectAdd 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.
If successful, the server will respond with a conversation.item.created
event, otherwise an error event will be sent.
Optional client-generated ID used to identify this event.
The event type, must be conversation.item.create.
Allowed values:conversation.item.create
The ID of the preceding item after which the new item will be inserted.
If not set, the new item will be appended to the end of the conversation.
If set to root, the new item will be added to the beginning of the conversation.
If set to an existing ID, it allows an item to be inserted mid-conversation. If the
ID cannot be found, an error will be returned and the item will not be added.
The item to add to the conversation.
Show Child Parameters
RealtimeClientEventConversationItemDelete
objectSend 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.
Optional client-generated ID used to identify this event.
The event type, must be conversation.item.delete.
Allowed values:conversation.item.delete
The ID of the item to delete.
RealtimeClientEventConversationItemTruncate
objectSend 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.
Truncating audio will delete the server-side text transcript to ensure there
is not text in the context that hasn’t been heard by the user.
If successful, the server will respond with a conversation.item.truncated
event.
Optional client-generated ID used to identify this event.
The event type, must be conversation.item.truncate.
Allowed values:conversation.item.truncate
The ID of the assistant message item to truncate. Only assistant message
items can be truncated.
The index of the content part to truncate. Set this to 0.
Inclusive duration up to which audio is truncated, in milliseconds. If
the audio_end_ms is greater than the actual audio duration, the server
will respond with an error.
RealtimeClientEventInputAudioBufferAppend
objectSend 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.
The client may choose how much audio to place in each event up to a maximum
of 15 MiB, for example streaming smaller chunks from the client may allow the
VAD to be more responsive. Unlike made other client events, the server will
not send a confirmation response to this event.
Optional client-generated ID used to identify this event.
The event type, must be input_audio_buffer.append.
Allowed values:input_audio_buffer.append
Base64-encoded audio bytes. This must be in the format specified by the
input_audio_format field in the session configuration.
RealtimeClientEventInputAudioBufferClear
objectSend this event to clear the audio bytes in the buffer. The server will
respond with an input_audio_buffer.cleared event.
Optional client-generated ID used to identify this event.
The event type, must be input_audio_buffer.clear.
Allowed values:input_audio_buffer.clear