Class: OpenAI::Models::Audio::TranscriptionCreateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Audio::TranscriptionCreateParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/openai/models/audio/transcription_create_params.rb
Overview
Defined Under Namespace
Modules: ChunkingStrategy, Model, TimestampGranularity
Instance Attribute Summary collapse
-
#chunking_strategy ⇒ Symbol, ...
Controls how the audio is cut into chunks.
-
#file ⇒ Pathname, ...
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
-
#include ⇒ Array<Symbol, OpenAI::Models::Audio::TranscriptionInclude>?
Additional information to include in the transcription response.
-
#known_speaker_names ⇒ Array<String>?
Optional list of speaker names that correspond to the audio samples provided in
known_speaker_references[]. -
#known_speaker_references ⇒ Array<String>?
Optional list of audio samples (as [data URLs](developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching
known_speaker_names[]. -
#language ⇒ String?
The language of the input audio.
-
#model ⇒ String, ...
ID of the model to use.
-
#prompt ⇒ String?
An optional text to guide the model’s style or continue a previous audio segment.
-
#response_format ⇒ Symbol, ...
The format of the output, in one of these options:
json,text,srt,verbose_json,vtt, ordiarized_json. -
#temperature ⇒ Float?
The sampling temperature, between 0 and 1.
-
#timestamp_granularities ⇒ Array<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>?
The timestamp granularities to populate for this transcription.
Attributes included from Internal::Type::RequestParameters
Class Method Summary collapse
- .values ⇒ Array<Symbol>
- .variants ⇒ Array(Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig)
Instance Method Summary collapse
-
#initialize(file:, model:, chunking_strategy: nil, include: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) ⇒ Object
constructor
Some parameter documentations has been truncated, see TranscriptionCreateParams for more details.
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
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
#initialize(file:, model:, chunking_strategy: nil, include: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::Audio::TranscriptionCreateParams for more details.
|
|
# File 'lib/openai/models/audio/transcription_create_params.rb', line 121
|
Instance Attribute Details
#chunking_strategy ⇒ Symbol, ...
Controls how the audio is cut into chunks. When set to ‘“auto”`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. server_vad object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. Required when using gpt-4o-transcribe-diarize for inputs longer than 30 seconds.
38 39 40 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 38 optional :chunking_strategy, union: -> { OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy }, nil?: true |
#file ⇒ Pathname, ...
The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
18 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 18 required :file, OpenAI::Internal::Type::FileInput |
#include ⇒ Array<Symbol, OpenAI::Models::Audio::TranscriptionInclude>?
Additional information to include in the transcription response. logprobs will return the log probabilities of the tokens in the response to understand the model’s confidence in the transcription. logprobs only works with response_format set to json and only with the models gpt-4o-transcribe, gpt-4o-mini-transcribe, and gpt-4o-mini-transcribe-2025-12-15. This field is not supported when using gpt-4o-transcribe-diarize.
51 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 51 optional :include, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionInclude] } |
#known_speaker_names ⇒ Array<String>?
Optional list of speaker names that correspond to the audio samples provided in known_speaker_references[]. Each entry should be a short identifier (for example customer or agent). Up to 4 speakers are supported.
59 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 59 optional :known_speaker_names, OpenAI::Internal::Type::ArrayOf[String] |
#known_speaker_references ⇒ Array<String>?
Optional list of audio samples (as [data URLs](developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs)) that contain known speaker references matching known_speaker_names[]. Each sample must be between 2 and 10 seconds, and can use any of the same input audio formats supported by file.
69 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 69 optional :known_speaker_references, OpenAI::Internal::Type::ArrayOf[String] |
#language ⇒ String?
The language of the input audio. Supplying the input language in [ISO-639-1](en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. en) format will improve accuracy and latency.
77 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 77 optional :language, String |
#model ⇒ String, ...
ID of the model to use. The options are gpt-4o-transcribe, gpt-4o-mini-transcribe, gpt-4o-mini-transcribe-2025-12-15, whisper-1 (which is powered by our open source Whisper V2 model), and gpt-4o-transcribe-diarize.
27 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 27 required :model, union: -> { OpenAI::Audio::TranscriptionCreateParams::Model } |
#prompt ⇒ String?
An optional text to guide the model’s style or continue a previous audio segment. The [prompt](platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using gpt-4o-transcribe-diarize.
87 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 87 optional :prompt, String |
#response_format ⇒ Symbol, ...
The format of the output, in one of these options: json, text, srt, verbose_json, vtt, or diarized_json. For gpt-4o-transcribe and gpt-4o-mini-transcribe, the only supported format is json. For gpt-4o-transcribe-diarize, the supported formats are json, text, and diarized_json, with diarized_json required to receive speaker annotations.
97 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 97 optional :response_format, enum: -> { OpenAI::AudioResponseFormat } |
#temperature ⇒ Float?
The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit.
107 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 107 optional :temperature, Float |
#timestamp_granularities ⇒ Array<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>?
The timestamp granularities to populate for this transcription. response_format must be set verbose_json to use timestamp granularities. Either or both of these options are supported: word, or segment. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. This option is not available for gpt-4o-transcribe-diarize.
118 119 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 118 optional :timestamp_granularities, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity] } |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/audio/transcription_create_params.rb', line 229
|
.variants ⇒ Array(Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig)
|
|
# File 'lib/openai/models/audio/transcription_create_params.rb', line 161
|