RealtimeClientEventConversationItemTruncate interface
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.
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.
- Extends
Properties
| audio_end_ms | 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. |
| content_index | The index of the content part to truncate. Set this to |
| event_id | Optional client-generated ID used to identify this event. |
| item_id | The ID of the assistant message item to truncate. Only assistant message items can be truncated. |
| type | The event type, must be |
Property Details
audio_end_ms
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.
audio_end_ms: number
Property Value
number
content_index
The index of the content part to truncate. Set this to 0.
content_index: number
Property Value
number
event_id
Optional client-generated ID used to identify this event.
event_id?: string
Property Value
string
item_id
The ID of the assistant message item to truncate. Only assistant message items can be truncated.
item_id: string
Property Value
string
type
The event type, must be conversation.item.truncate.
type: "conversation.item.truncate"
Property Value
"conversation.item.truncate"