Class: OpenAI::Models::Live::ResponseItemCreateEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/response_item_create_event.rb,
sig/openai/models/live/response_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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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, type: :"response.item.create") ⇒ ResponseItemCreateEvent

Returns a new instance of ResponseItemCreateEvent.

Parameters:

  • item —

    An input item to append to the Responses backend conversation, such as a user message or a function tool result.

  • event_id (defaults to: nil) —

    Optional client identifier for correlating this command with a server event's client_event_id or error.client_event_id.

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

    The Live client event type. Always response.item.create.

  • item: (OpenAI::Models::Responses::response_input_item)
  • event_id: (String, nil) (defaults to: nil)
  • type: (:"response.item.create") (defaults to: :"response.item.create")


# File 'lib/openai/models/live/response_item_create_event.rb', line 27

Instance Attribute Details

#event_id ⇒ String?

Optional client identifier for correlating this command with a server event's client_event_id or error.client_event_id.

Returns:

  • (String, nil)


25
# File 'lib/openai/models/live/response_item_create_event.rb', line 25

optional :event_id, String, nil?: true

#item ⇒ OpenAI::Models::Responses::response_input_item

An input item to append to the Responses backend conversation, such as a user message or a function tool result.

Returns:

  • (OpenAI::Models::Responses::response_input_item)


12
# File 'lib/openai/models/live/response_item_create_event.rb', line 12

required :item, union: -> { OpenAI::Responses::ResponseInputItem }

#type ⇒ :"response.item.create"

The Live client event type. Always response.item.create.

Returns:

  • (:"response.item.create")


18
# File 'lib/openai/models/live/response_item_create_event.rb', line 18

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

Instance Method Details

#to_hash ⇒ { item: OpenAI::Models::Responses::response_input_item, ?type: :"response.item.create", ?event_id: String? }

Returns:

  • ({ item: OpenAI::Models::Responses::response_input_item, ?type: :"response.item.create", ?event_id: String? })


37
38
39
40
41
# File 'sig/openai/models/live/response_item_create_event.rbs', line 37

def to_hash: -> {
  item: OpenAI::Models::Responses::response_input_item,
  ?type: :"response.item.create",
  ?event_id: String?
}