Class: OpenAI::Models::Realtime::ConversationItemTruncateEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/conversation_item_truncate_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(audio_end_ms:, content_index:, item_id:, event_id: nil, type: :"conversation.item.truncate") ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Realtime::ConversationItemTruncateEvent for more details.

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.

Parameters:

  • audio_end_ms (Integer)

    Inclusive duration up to which audio is truncated, in milliseconds. If

  • content_index (Integer)

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

  • item_id (String)

    The ID of the assistant message item to truncate. Only assistant message

  • event_id (String) (defaults to: nil)

    Optional client-generated ID used to identify this event.

  • type (Symbol, :"conversation.item.truncate") (defaults to: :"conversation.item.truncate")

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



# File 'lib/openai/models/realtime/conversation_item_truncate_event.rb', line 40

Instance Attribute Details

#audio_end_msInteger

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.

Returns:

  • (Integer)


13
# File 'lib/openai/models/realtime/conversation_item_truncate_event.rb', line 13

required :audio_end_ms, Integer

#content_indexInteger

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

Returns:

  • (Integer)


19
# File 'lib/openai/models/realtime/conversation_item_truncate_event.rb', line 19

required :content_index, Integer

#event_idString?

Optional client-generated ID used to identify this event.

Returns:

  • (String, nil)


38
# File 'lib/openai/models/realtime/conversation_item_truncate_event.rb', line 38

optional :event_id, String

#item_idString

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

Returns:

  • (String)


26
# File 'lib/openai/models/realtime/conversation_item_truncate_event.rb', line 26

required :item_id, String

#typeSymbol, :"conversation.item.truncate"

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

Returns:

  • (Symbol, :"conversation.item.truncate")


32
# File 'lib/openai/models/realtime/conversation_item_truncate_event.rb', line 32

required :type, const: :"conversation.item.truncate"