Class: OpenAI::Models::Realtime::AudioTranscription

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

Defined Under Namespace

Modules: Delay, Model

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_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(delay: nil, keywords: nil, language: nil, languages: nil, model: nil, prompt: nil) ⇒ Object

Parameters:

  • delay (defaults to: nil) —

    Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with gpt-realtime-whisper in GA Realtime sessions.

  • keywords (defaults to: nil) —

    Words or phrases to guide transcription of the input audio. Supported by gpt-transcribe and gpt-live-transcribe.

  • language (defaults to: nil) —

    The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.

  • languages (defaults to: nil) —

    Possible languages of the input audio, in ISO-639-1 format. Supported by gpt-transcribe and gpt-live-transcribe.

  • model (defaults to: nil) —

    The model to use for transcription. Current options are whisper-1, gpt-transcribe, gpt-live-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, gpt-4o-transcribe, gpt-4o-transcribe-diarize, and gpt-realtime-whisper. Use gpt-4o-transcribe-diarize when you need diarization with speaker labels.

  • prompt (defaults to: nil) —

    An optional text to guide the model's style or continue a previous audio segment. For whisper-1, the prompt is a list of keywords. For gpt-4o-transcribe models (excluding gpt-4o-transcribe-diarize), the prompt is a free text string, for example "expect words related to technology". Prompt is not supported with gpt-realtime-whisper in GA Realtime sessions.



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

Instance Attribute Details

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

Controls how long the model waits before emitting transcription text. Higher values can improve transcription accuracy at the cost of latency. Only supported with gpt-realtime-whisper in GA Realtime sessions.

Returns:

  • (OpenAI::Models::Realtime::AudioTranscription::delay, nil)


13
# File 'lib/openai/models/realtime/audio_transcription.rb', line 13

optional :delay, enum: -> { OpenAI::Realtime::AudioTranscription::Delay }

#keywords ⇒ ::Array[String]?

Words or phrases to guide transcription of the input audio. Supported by gpt-transcribe and gpt-live-transcribe.

Returns:

  • (::Array[String], nil)


20
# File 'lib/openai/models/realtime/audio_transcription.rb', line 20

optional :keywords, OpenAI::Internal::Type::ArrayOf[String]

#language ⇒ String?

The language of the input audio. Supplying the input language in ISO-639-1 (e.g. en) format will improve accuracy and latency.

Returns:

  • (String, nil)


28
# File 'lib/openai/models/realtime/audio_transcription.rb', line 28

optional :language, String

#languages ⇒ ::Array[String]?

Possible languages of the input audio, in ISO-639-1 format. Supported by gpt-transcribe and gpt-live-transcribe.

Returns:

  • (::Array[String], nil)


36
# File 'lib/openai/models/realtime/audio_transcription.rb', line 36

optional :languages, OpenAI::Internal::Type::ArrayOf[String]

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

The model to use for transcription. Current options are whisper-1, gpt-transcribe, gpt-live-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, gpt-4o-transcribe, gpt-4o-transcribe-diarize, and gpt-realtime-whisper. Use gpt-4o-transcribe-diarize when you need diarization with speaker labels.

Returns:

  • (OpenAI::Models::Realtime::AudioTranscription::model, nil)


46
# File 'lib/openai/models/realtime/audio_transcription.rb', line 46

optional :model, union: -> { OpenAI::Realtime::AudioTranscription::Model }

#prompt ⇒ String?

An optional text to guide the model's style or continue a previous audio segment. For whisper-1, the prompt is a list of keywords. For gpt-4o-transcribe models (excluding gpt-4o-transcribe-diarize), the prompt is a free text string, for example "expect words related to technology". Prompt is not supported with gpt-realtime-whisper in GA Realtime sessions.

Returns:

  • (String, nil)


57
# File 'lib/openai/models/realtime/audio_transcription.rb', line 57

optional :prompt, String

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/audio_transcription.rb', line 108

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


124
# File 'sig/openai/models/realtime/audio_transcription.rbs', line 124

def to_hash: -> {