Class: OpenAI::Models::Realtime::SessionUpdateEvent

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

Defined Under Namespace

Modules: Session

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(session:, event_id: nil, type: :"session.update") ⇒ SessionUpdateEvent

Returns a new instance of SessionUpdateEvent.

Parameters:

  • session —

    Update the Realtime session. Choose either a realtime session or a transcription session.

  • event_id (defaults to: nil) —

    Optional client-generated ID used to identify this event. This is an arbitrary string that a client may assign. It will be passed back if there is an error with the event, but the corresponding session.updated event will not include it.

  • type (defaults to: :"session.update") —

    The event type, must be session.update.

  • session: (OpenAI::Models::Realtime::SessionUpdateEvent::session)
  • event_id: (String) (defaults to: nil)
  • type: (:"session.update") (defaults to: :"session.update")


# File 'lib/openai/models/realtime/session_update_event.rb', line 29

Instance Attribute Details

#event_id ⇒ String?

Optional client-generated ID used to identify this event. This is an arbitrary string that a client may assign. It will be passed back if there is an error with the event, but the corresponding session.updated event will not include it.

Returns:

  • (String, nil)


27
# File 'lib/openai/models/realtime/session_update_event.rb', line 27

optional :event_id, String

#session ⇒ OpenAI::Models::Realtime::SessionUpdateEvent::session

Update the Realtime session. Choose either a realtime session or a transcription session.

Returns:

  • (OpenAI::Models::Realtime::SessionUpdateEvent::session)


12
# File 'lib/openai/models/realtime/session_update_event.rb', line 12

required :session, union: -> { OpenAI::Realtime::SessionUpdateEvent::Session }

#type ⇒ :"session.update"

The event type, must be session.update.

Returns:



18
# File 'lib/openai/models/realtime/session_update_event.rb', line 18

required :type, const: :"session.update"

Instance Method Details

#to_hash ⇒ { session: OpenAI::Models::Realtime::SessionUpdateEvent::session, ?type: :"session.update", ?event_id: String }

Returns:

  • ({ session: OpenAI::Models::Realtime::SessionUpdateEvent::session, ?type: :"session.update", ?event_id: String })


47
48
49
50
51
# File 'sig/openai/models/realtime/session_update_event.rbs', line 47

def to_hash: -> {
  session: OpenAI::Models::Realtime::SessionUpdateEvent::session,
  ?type: :"session.update",
  ?event_id: String
}