Class: OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session

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

Overview

See Also:

  • OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent#session

Defined Under Namespace

Modules: Modality Classes: ClientSecret, TurnDetection

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(expires_at:, value:) ⇒ Session

Returns a new instance of Session.

Parameters:

  • client_secret —

    Ephemeral key returned by the API. Only present when the session is created on the server via REST API.

  • input_audio_format —

    The format of input audio. Options are pcm16, g711_ulaw, or g711_alaw.

  • modalities —

    The set of modalities the model can respond with. To disable audio, set this to ["text"].

  • turn_detection —

    Configuration for turn detection. Can be set to null to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

  • client_secret: (OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret)
  • input_audio_format: (String)
  • input_audio_transcription: (OpenAI::Realtime::AudioTranscription)
  • modalities: (::Array[OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::modality])
  • turn_detection: (OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection)


# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 91

Instance Attribute Details

#client_secret ⇒ OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret

Ephemeral key returned by the API. Only present when the session is created on the server via REST API.

Returns:

  • (OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret)


53
# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 53

required :client_secret, -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret }

#input_audio_format ⇒ String?

The format of input audio. Options are pcm16, g711_ulaw, or g711_alaw.

Returns:

  • (String, nil)


59
# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 59

optional :input_audio_format, String

#input_audio_transcription ⇒ OpenAI::Models::Realtime::AudioTranscription?

Parameters:

  • (OpenAI::Realtime::AudioTranscription)

Returns:



64
# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 64

optional :input_audio_transcription, -> { OpenAI::Realtime::AudioTranscription }

#modalities ⇒ ::Array[OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::modality]?

The set of modalities the model can respond with. To disable audio, set this to ["text"].

Returns:

  • (::Array[OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::modality], nil)


71
72
73
74
75
76
77
78
# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 71

optional(
  :modalities,
  -> {
    OpenAI::Internal::Type::ArrayOf[
      enum: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::Modality
    ]
  }
)

#turn_detection ⇒ OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection?

Configuration for turn detection. Can be set to null to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech.

Returns:

  • (OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection, nil)


86
87
88
89
# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 86

optional(
  :turn_detection,
  -> { OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection }
)

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/transcription_session_updated_event.rb', line 153

Instance Method Details

#to_hash ⇒ { client_secret: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret, ?input_audio_format: String, ?input_audio_transcription: OpenAI::Realtime::AudioTranscription, ?modalities: ::Array[OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::modality], ?turn_detection: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection }

Returns:

  • ({ client_secret: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret, ?input_audio_format: String, ?input_audio_transcription: OpenAI::Realtime::AudioTranscription, ?modalities: ::Array[OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::modality], ?turn_detection: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection })


115
116
117
118
119
120
121
# File 'sig/openai/models/realtime/transcription_session_updated_event.rbs', line 115

def to_hash: -> {
  client_secret: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::ClientSecret,
  ?input_audio_format: String,
  ?input_audio_transcription: OpenAI::Realtime::AudioTranscription,
  ?modalities: ::Array[OpenAI::Models::Realtime::TranscriptionSessionUpdatedEvent::Session::modality],
  ?turn_detection: OpenAI::Realtime::TranscriptionSessionUpdatedEvent::Session::TurnDetection
}