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_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(event:, event_id:, client_event_id: nil, delegation_id: nil, type: :"response.event") ⇒ Object

A streaming Responses API event from a backend delegated to by the Live session. Use the outer delegation_id to associate the nested stream with its Live delegation.

Parameters:

  • event (Hash{Symbol=>Object})

    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 (String)

    The unique ID of the Live server event.

  • client_event_id (String) (defaults to: nil)

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

  • delegation_id (String, nil) (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 (Symbol, :"response.event") (defaults to: :"response.event")

    The event type, always response.event.



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

Instance Attribute Details

#client_event_idString?

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

Parameters:

  • (String)

Returns:

  • (String, nil)


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

optional :client_event_id, String

#delegation_idString?

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

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :delegation_id, String, nil?: true

#eventHash{Symbol=>Object}

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.

Parameters:

  • value (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object})


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

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

#event_idString

The unique ID of the Live server event.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :event_id, String

#typeSymbol, :"response.event"

The event type, always response.event.

Parameters:

  • value (:"response.event")

Returns:

  • (Symbol, :"response.event")


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

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

Instance Method Details

#to_hash{

Returns:

  • ({)


34
# File 'sig/openai/models/live/response_event.rbs', line 34

def to_hash: -> {