Class: OpenAI::Models::Live::DataChannelConfig

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

Defined Under Namespace

Modules: AllowedClientEvents, AllowedServerEvents

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(allowed_client_events: nil, allowed_server_events: nil) ⇒ Object

Control which Live events an untrusted WebRTC frontend can send and receive over its data channel. These restrictions do not apply to trusted sideband connections.

Parameters:

  • allowed_client_events (Symbol, :all, Array<String>) (defaults to: nil)

    Client event types that the frontend data channel may send. Use 'all' to allow every client event; an empty array allows none. Omission preserves the existing allow-all behavior.

  • allowed_server_events (Symbol, :all, Array<OpenAI::Models::Live::ServerEventSelector>) (defaults to: nil)

    Server events that may be sent to the frontend data channel. Use 'all' to allow every server event; an empty array allows none. Omission preserves the existing allow-all behavior. Responses events use an object with type 'response.event' and a response_event selector.



# File 'lib/openai/models/live/data_channel_config.rb', line 24

Instance Attribute Details

#allowed_client_eventsSymbol, ...

Client event types that the frontend data channel may send. Use 'all' to allow every client event; an empty array allows none. Omission preserves the existing allow-all behavior.

Returns:

  • (Symbol, :all, Array<String>, nil)


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

optional :allowed_client_events, union: -> { OpenAI::Live::DataChannelConfig::AllowedClientEvents }

#allowed_server_eventsSymbol, ...

Server events that may be sent to the frontend data channel. Use 'all' to allow every server event; an empty array allows none. Omission preserves the existing allow-all behavior. Responses events use an object with type 'response.event' and a response_event selector.

Returns:



22
# File 'lib/openai/models/live/data_channel_config.rb', line 22

optional :allowed_server_events, union: -> { OpenAI::Live::DataChannelConfig::AllowedServerEvents }

Instance Method Details

#to_hash{

Returns:

  • ({)


28
# File 'sig/openai/models/live/data_channel_config.rbs', line 28

def to_hash: -> {