Class: OpenAI::Models::Live::MediaSessionConfig

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

Defined Under Namespace

Modules: Delegation, Model Classes: Audio, WakePolicy

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

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(decisions:, acknowledgement_delay_ms: nil, type: :decisions) ⇒ MediaSessionConfig

Returns a new instance of MediaSessionConfig.

Parameters:

  • model —

    The Live model. Required in the session configuration for every transport; do not pass it as a URL query parameter.

  • audio —

    Startup audio configuration. WebRTC and SIP negotiate their audio format on the media transport.

  • client —

    Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.

  • delegation —

    Who handles tasks delegated by the Live model. Omitted or null selects your application; use responses or decisions to delegate to the corresponding API.

  • idle_timeout_s —

    Whole seconds of inactivity after which a Live WebRTC or SIP session with a speech wake policy pauses inference. The connection and conversation history are retained. Omit to keep inference active after the first wake until the session ends.

  • input —

    Ordered text-only history supplied before startup. Supports developer, user, and assistant messages with one text part each; at most 128 messages and a configured rendered-token limit (8,192 by default).

  • instructions —

    Frontend instructions for voice, conversation, interruptions, and when to delegate. Start with the Live prompting guide; put business rules and tool workflows in a separate backend prompt. Limited to 16,384 client-supplied tokens. Omitted or blank instructions use server defaults. Immutable after startup.

  • safety_identifier —

    A stable identifier for your end user, used for safety monitoring and abuse detection.

  • store —

    Whether to store the session for later forking and recording download. Defaults to false for new sessions.

  • triggers —

    At most one Decisions trigger per transcript event type. Triggers run independently of delegation. On update, omit triggers to keep the current configuration, send a list to replace it, or send an empty list to disable triggers.

  • wake_policy —

    Starts inference when microphone speech is detected.

  • model: (OpenAI::Models::Live::MediaSessionConfig::model)
  • audio: (OpenAI::Live::MediaSessionConfig::Audio)
  • client: (OpenAI::Live::ClientConfig)
  • delegation: (OpenAI::Models::Live::MediaSessionConfig::delegation, nil)
  • idle_timeout_s: (Integer)
  • input: (::Array[OpenAI::Models::Live::initial_item])
  • instructions: (String, nil)
  • safety_identifier: (String, nil)
  • store: (Boolean)
  • triggers: (::Array[OpenAI::Live::DecisionTrigger])
  • wake_policy: (OpenAI::Live::MediaSessionConfig::WakePolicy)


# File 'lib/openai/models/live/media_session_config.rb', line 94

Instance Attribute Details

#audio ⇒ OpenAI::Live::MediaSessionConfig::Audio?

Startup audio configuration. WebRTC and SIP negotiate their audio format on the media transport.

Returns:

  • (OpenAI::Live::MediaSessionConfig::Audio, nil)


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

optional :audio, -> { OpenAI::Live::MediaSessionConfig::Audio }

#client ⇒ OpenAI::Live::ClientConfig?

Startup-only capabilities for an untrusted frontend attached to a unified WebRTC session. Trusted sideband connections are unaffected.

Returns:

  • (OpenAI::Live::ClientConfig, nil)


26
# File 'lib/openai/models/live/media_session_config.rb', line 26

optional :client, -> { OpenAI::Live::ClientConfig }

#delegation ⇒ OpenAI::Models::Live::MediaSessionConfig::delegation?

Who handles tasks delegated by the Live model. Omitted or null selects your application; use responses or decisions to delegate to the corresponding API.

Returns:

  • (OpenAI::Models::Live::MediaSessionConfig::delegation, nil)


34
# File 'lib/openai/models/live/media_session_config.rb', line 34

optional :delegation, union: -> { OpenAI::Live::MediaSessionConfig::Delegation }, nil?: true

#idle_timeout_s ⇒ Integer?

Whole seconds of inactivity after which a Live WebRTC or SIP session with a speech wake policy pauses inference. The connection and conversation history are retained. Omit to keep inference active after the first wake until the session ends.

Returns:

  • (Integer, nil)


43
# File 'lib/openai/models/live/media_session_config.rb', line 43

optional :idle_timeout_s, Integer

#input ⇒ ::Array[OpenAI::Models::Live::initial_item]?

Ordered text-only history supplied before startup. Supports developer, user, and assistant messages with one text part each; at most 128 messages and a configured rendered-token limit (8,192 by default).

Returns:

  • (::Array[OpenAI::Models::Live::initial_item], nil)


51
# File 'lib/openai/models/live/media_session_config.rb', line 51

optional :input, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Live::InitialItem] }

#instructions ⇒ String?

Frontend instructions for voice, conversation, interruptions, and when to delegate. Start with the Live prompting guide; put business rules and tool workflows in a separate backend prompt. Limited to 16,384 client-supplied tokens. Omitted or blank instructions use server defaults. Immutable after startup.

Returns:

  • (String, nil)


63
# File 'lib/openai/models/live/media_session_config.rb', line 63

optional :instructions, String, nil?: true

#model ⇒ OpenAI::Models::Live::MediaSessionConfig::model

The Live model. Required in the session configuration for every transport; do not pass it as a URL query parameter.

Returns:

  • (OpenAI::Models::Live::MediaSessionConfig::model)


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

required :model, union: -> { OpenAI::Live::MediaSessionConfig::Model }

#safety_identifier ⇒ String?

A stable identifier for your end user, used for safety monitoring and abuse detection.

Returns:

  • (String, nil)


70
# File 'lib/openai/models/live/media_session_config.rb', line 70

optional :safety_identifier, String, nil?: true

#store ⇒ Boolean?

Whether to store the session for later forking and recording download. Defaults to false for new sessions.

Returns:



77
# File 'lib/openai/models/live/media_session_config.rb', line 77

optional :store, OpenAI::Internal::Type::Boolean

#triggers ⇒ ::Array[OpenAI::Live::DecisionTrigger]?

At most one Decisions trigger per transcript event type. Triggers run independently of delegation. On update, omit triggers to keep the current configuration, send a list to replace it, or send an empty list to disable triggers.

Returns:

  • (::Array[OpenAI::Live::DecisionTrigger], nil)


86
# File 'lib/openai/models/live/media_session_config.rb', line 86

optional :triggers, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::DecisionTrigger] }

#wake_policy ⇒ OpenAI::Live::MediaSessionConfig::WakePolicy?

Starts inference when microphone speech is detected.

Returns:

  • (OpenAI::Live::MediaSessionConfig::WakePolicy, nil)


92
# File 'lib/openai/models/live/media_session_config.rb', line 92

optional :wake_policy, -> { OpenAI::Live::MediaSessionConfig::WakePolicy }

Class Method Details

.variants ⇒ Array(OpenAI::Models::Live::ClientDelegation, OpenAI::Models::Live::MediaSessionConfig::Delegation::Responses, OpenAI::Models::Live::MediaSessionConfig::Delegation::Decisions)



# File 'lib/openai/models/live/media_session_config.rb', line 230

Instance Method Details

#to_hash ⇒ { model: OpenAI::Models::Live::MediaSessionConfig::model, ?audio: OpenAI::Live::MediaSessionConfig::Audio, ?client: OpenAI::Live::ClientConfig, ?delegation: OpenAI::Models::Live::MediaSessionConfig::delegation?, ?idle_timeout_s: Integer, ?input: ::Array[OpenAI::Models::Live::initial_item], ?instructions: String?, ?safety_identifier: String?, ?store: bool, ?triggers: ::Array[OpenAI::Live::DecisionTrigger], ?wake_policy: OpenAI::Live::MediaSessionConfig::WakePolicy }

Returns:

  • ({ model: OpenAI::Models::Live::MediaSessionConfig::model, ?audio: OpenAI::Live::MediaSessionConfig::Audio, ?client: OpenAI::Live::ClientConfig, ?delegation: OpenAI::Models::Live::MediaSessionConfig::delegation?, ?idle_timeout_s: Integer, ?input: ::Array[OpenAI::Models::Live::initial_item], ?instructions: String?, ?safety_identifier: String?, ?store: bool, ?triggers: ::Array[OpenAI::Live::DecisionTrigger], ?wake_policy: OpenAI::Live::MediaSessionConfig::WakePolicy })


171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'sig/openai/models/live/media_session_config.rbs', line 171

def to_hash: -> {
  model: OpenAI::Models::Live::MediaSessionConfig::model,
  ?audio: OpenAI::Live::MediaSessionConfig::Audio,
  ?client: OpenAI::Live::ClientConfig,
  ?delegation: OpenAI::Models::Live::MediaSessionConfig::delegation?,
  ?idle_timeout_s: Integer,
  ?input: ::Array[OpenAI::Models::Live::initial_item],
  ?instructions: String?,
  ?safety_identifier: String?,
  ?store: bool,
  ?triggers: ::Array[OpenAI::Live::DecisionTrigger],
  ?wake_policy: OpenAI::Live::MediaSessionConfig::WakePolicy
}