Class: OpenAI::Models::Live::ResponseEvent

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/response_event.rb,
sig/openai/models/live/response_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(event:, event_id:, client_event_id: nil, delegation_id: nil, type: :"response.event") ⇒ ResponseEvent

Returns a new instance of ResponseEvent.

Parameters:

  • event —

    The nested Responses streaming event. Dispatch on its type field. Response lifecycle snapshots omit input and clear instructions, tools, and output to keep messages small; consume granular output events for the generated content.

  • event_id —

    The unique ID of the Live server event.

  • client_event_id (defaults to: nil) —

    The event_id of the client command associated with this server event, when supplied.

  • delegation_id (defaults to: nil) —

    The Live delegation associated with the nested Responses event. May be null or omitted when the event cannot be correlated with a delegation.

  • type (defaults to: :"response.event") —

    The event type, always response.event.

  • event: (::Hash[Symbol, top])
  • event_id: (String)
  • client_event_id: (String) (defaults to: nil)
  • delegation_id: (String, nil) (defaults to: nil)
  • type: (:"response.event") (defaults to: :"response.event")


# File 'lib/openai/models/live/response_event.rb', line 41

Instance Attribute Details

#client_event_id ⇒ String?

The event_id of the client command associated with this server event, when supplied.

Returns:

  • (String, nil)


32
# File 'lib/openai/models/live/response_event.rb', line 32

optional :client_event_id, String

#delegation_id ⇒ String?

The Live delegation associated with the nested Responses event. May be null or omitted when the event cannot be correlated with a delegation.

Returns:

  • (String, nil)


39
# File 'lib/openai/models/live/response_event.rb', line 39

optional :delegation_id, String, nil?: true

#event ⇒ ::Hash[Symbol, top]

The nested Responses streaming event. Dispatch on its type field. Response lifecycle snapshots omit input and clear instructions, tools, and output to keep messages small; consume granular output events for the generated content.

Returns:

  • (::Hash[Symbol, top])


13
# File 'lib/openai/models/live/response_event.rb', line 13

required :event, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]

#event_id ⇒ String

The unique ID of the Live server event.

Returns:

  • (String)


19
# File 'lib/openai/models/live/response_event.rb', line 19

required :event_id, String

#type ⇒ :"response.event"

The event type, always response.event.

Returns:



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

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

Instance Method Details

#to_hash ⇒ { event: ::Hash[Symbol, top], event_id: String, ?type: :"response.event", ?client_event_id: String, ?delegation_id: String? }

Returns:

  • ({ event: ::Hash[Symbol, top], event_id: String, ?type: :"response.event", ?client_event_id: String, ?delegation_id: String? })


59
60
61
62
63
64
65
# File 'sig/openai/models/live/response_event.rbs', line 59

def to_hash: -> {
  event: ::Hash[Symbol, top],
  event_id: String,
  ?type: :"response.event",
  ?client_event_id: String,
  ?delegation_id: String?
}