Class: OpenAI::Models::Realtime::ConversationItemCreateEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/conversation_item_create_event.rb,
sig/openai/models/realtime/conversation_item_create_event.rbs

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_with_error, 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(item:, event_id: nil, previous_item_id: nil, type: :"conversation.item.create") ⇒ Object

Parameters:

  • item —

    A single item within a Realtime conversation.

  • event_id (defaults to: nil) —

    Optional client-generated ID used to identify this event.

  • previous_item_id (defaults to: nil) —

    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.

  • type (defaults to: :"conversation.item.create") —

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



# File 'lib/openai/models/realtime/conversation_item_create_event.rb', line 39

Instance Attribute Details

#event_id ⇒ String?

Optional client-generated ID used to identify this event.

Returns:

  • (String, nil)


23
# File 'lib/openai/models/realtime/conversation_item_create_event.rb', line 23

optional :event_id, String

#item ⇒ OpenAI::Models::Realtime::conversation_item

A single item within a Realtime conversation.

Returns:

  • (OpenAI::Models::Realtime::conversation_item)


11
# File 'lib/openai/models/realtime/conversation_item_create_event.rb', line 11

required :item, union: -> { OpenAI::Realtime::ConversationItem }

#previous_item_id ⇒ String?

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.

Returns:

  • (String, nil)


37
# File 'lib/openai/models/realtime/conversation_item_create_event.rb', line 37

optional :previous_item_id, String

#type ⇒ :"conversation.item.create"

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

Returns:

  • (:"conversation.item.create")


17
# File 'lib/openai/models/realtime/conversation_item_create_event.rb', line 17

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

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


70
# File 'sig/openai/models/realtime/conversation_item_create_event.rbs', line 70

def to_hash: -> {