class

OpenAI::RealtimeBetaClientEventConversationItemTruncate

Inherits JSON::Serializable < Reference < Object

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.

Constructors

new(event_id : String | Nil = nil, type_value : Hash(String, JSON::Any) = Hash(String, JSON::Any).new, item_id : String = "", content_index : Int64 = 0, audio_end_ms : Int64 = 0)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

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.

Source
audio_end_ms=(audio_end_ms : Int64)

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.

Source
content_index

The index of the content part to truncate. Set this to 0.

Source
content_index=(content_index : Int64)

The index of the content part to truncate. Set this to 0.

Source
event_id

Optional client-generated ID used to identify this event.

Source
event_id=(event_id : String | Nil)

Optional client-generated ID used to identify this event.

Source
item_id

The ID of the assistant message item to truncate. Only assistant message items can be truncated.

Source
item_id=(item_id : String)

The ID of the assistant message item to truncate. Only assistant message items can be truncated.

Source
type_value

The event type, must be conversation.item.truncate.

Source
type_value=(type_value : Hash(String, JSON::Any))

The event type, must be conversation.item.truncate.

Source