Class: OpenAI::Models::Realtime::ResponseCreateEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/response_create_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(event_id: nil, response: nil, type: :"response.create") ⇒ Object

This event instructs the server to create a Response, which means triggering model inference. When in Server VAD mode, the server will create Responses automatically.

A Response will include at least one Item, and may have two, in which case the second will be a function call. These Items will be appended to the conversation history by default.

The server will respond with a ‘response.created` event, events for Items and content created, and finally a `response.done` event to indicate the Response is complete.

The ‘response.create` event includes inference configuration like `instructions` and `tools`. If these are set, they will override the Session’s configuration for this Response only.

Responses can be created out-of-band of the default Conversation, meaning that they can have arbitrary input, and it’s possible to disable writing the output to the Conversation. Only one Response can write to the default Conversation at a time, but otherwise multiple Responses can be created in parallel. The ‘metadata` field is a good way to disambiguate multiple simultaneous Responses.

Clients can set ‘conversation` to `none` to create a Response that does not write to the default Conversation. Arbitrary input can be provided with the `input` field, which is an array accepting raw Items and references to existing Items.

Parameters:

  • event_id (String) (defaults to: nil)

    Optional client-generated ID used to identify this event.

  • response (OpenAI::Models::Realtime::RealtimeResponseCreateParams) (defaults to: nil)

    Create a new Realtime response with these parameters

  • type (Symbol, :"response.create") (defaults to: :"response.create")

    The event type, must be ‘response.create`.



# File 'lib/openai/models/realtime/response_create_event.rb', line 25


Instance Attribute Details

#event_idString?

Optional client-generated ID used to identify this event.

Returns:

  • (String, nil)


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

optional :event_id, String

#responseOpenAI::Models::Realtime::RealtimeResponseCreateParams?

Create a new Realtime response with these parameters



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

optional :response, -> { OpenAI::Realtime::RealtimeResponseCreateParams }

#typeSymbol, :"response.create"

The event type, must be ‘response.create`.

Returns:



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

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