Class: OpenAI::Models::Realtime::RealtimeSessionCreateResponse::Audio::Input::TurnDetection::ServerVad

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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

#initializeObject



271
# File 'sig/openai/models/realtime/realtime_session_create_response.rbs', line 271

def initialize: (

Instance Attribute Details

#create_responseBoolean?

Whether or not to automatically generate a response when a VAD stop event occurs. If interrupt_response is set to false this may fail to create a response if the model is already responding.

If both create_response and interrupt_response are set to false, the model will never respond automatically but VAD events will still be emitted.

Parameters:

Returns:



339
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 339

optional :create_response, OpenAI::Internal::Type::Boolean

#idle_timeout_msInteger?

Optional timeout after which a model response will be triggered automatically. This is useful for situations in which a long pause from the user is unexpected, such as a phone call. The model will effectively prompt the user to continue the conversation based on the current context.

The timeout value will be applied after the last model response's audio has finished playing, i.e. it's set to the response.done time plus audio playback duration.

An input_audio_buffer.timeout_triggered event (plus events associated with the Response) will be emitted when the timeout is reached. Idle timeout is currently only supported for server_vad mode.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


356
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 356

optional :idle_timeout_ms, Integer, nil?: true

#interrupt_responseBoolean?

Whether or not to automatically interrupt (cancel) any ongoing response with output to the default conversation (i.e. conversation of auto) when a VAD start event occurs. If true then the response will be cancelled, otherwise it will continue until complete.

If both create_response and interrupt_response are set to false, the model will never respond automatically but VAD events will still be emitted.

Parameters:

Returns:



368
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 368

optional :interrupt_response, OpenAI::Internal::Type::Boolean

#prefix_padding_msInteger?

Used only for server_vad mode. Amount of audio to include before the VAD detected speech (in milliseconds). Defaults to 300ms.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


375
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 375

optional :prefix_padding_ms, Integer

#silence_duration_msInteger?

Used only for server_vad mode. Duration of silence to detect speech stop (in milliseconds). Defaults to 500ms. With shorter values the model will respond more quickly, but may jump in on short pauses from the user.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


383
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 383

optional :silence_duration_ms, Integer

#thresholdFloat?

Used only for server_vad mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A higher threshold will require louder audio to activate the model, and thus might perform better in noisy environments.

Parameters:

  • (Float)

Returns:

  • (Float, nil)


391
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 391

optional :threshold, Float

#typeSymbol, :server_vad

Type of turn detection, server_vad to turn on simple Server VAD.

Parameters:

  • value (:server_vad)

Returns:

  • (Symbol, :server_vad)


328
# File 'lib/openai/models/realtime/realtime_session_create_response.rb', line 328

required :type, const: :server_vad

Instance Method Details

#to_hash{

Returns:

  • ({)


281
# File 'sig/openai/models/realtime/realtime_session_create_response.rbs', line 281

def to_hash: -> {