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,
sig/openai/models/audio/transcription_create_params.rbs
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.
-
#keywords ⇒ Array<String>?
Words or phrases to guide transcription of the input audio.
-
#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) that contain known speaker references matching
known_speaker_names[]. -
#language ⇒ String?
The language of the input audio.
-
#languages ⇒ Array<String>?
Possible languages of the input audio, in ISO-639-1 format.
-
#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
Attributes inherited from Internal::Type::BaseModel
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, keywords: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, languages: 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.
- #to_hash ⇒ {
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
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, #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, keywords: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, languages: 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 142
|
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.
44 45 46 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 44 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. The request must include enough format metadata for the file to be identified. We recommend an extension-bearing filename and an appropriate content type.
String, StringIO, and pathless IO inputs are sent with generic upload
metadata. Use OpenAI::FilePart when you need to override the filename or
content type.
24 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 24 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.
57 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 57 optional :include, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionInclude] } |
#keywords ⇒ Array<String>?
Words or phrases to guide transcription of the input audio. Supported by
gpt-transcribe.
64 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 64 optional :keywords, OpenAI::Internal::Type::ArrayOf[String] |
#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.
72 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 72 optional :known_speaker_names, OpenAI::Internal::Type::ArrayOf[String] |
#known_speaker_references ⇒ Array<String>?
Optional list of audio samples (as
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.
82 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 82 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 (e.g. en)
format will improve accuracy and latency.
90 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 90 optional :language, String |
#languages ⇒ Array<String>?
Possible languages of the input audio, in
ISO-639-1 format.
Supported by gpt-transcribe.
98 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 98 optional :languages, OpenAI::Internal::Type::ArrayOf[String] |
#model ⇒ String, ...
ID of the model to use. The options are gpt-transcribe, 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.
33 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 33 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
should match the audio language. This field is not supported when using
gpt-4o-transcribe-diarize.
108 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 108 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.
118 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 118 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 to automatically increase the temperature until certain thresholds are hit.
128 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 128 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.
139 140 |
# File 'lib/openai/models/audio/transcription_create_params.rb', line 139 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 254
|
.variants ⇒ Array(Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig)
|
|
# File 'lib/openai/models/audio/transcription_create_params.rb', line 186
|
Instance Method Details
#to_hash ⇒ {
95 |
# File 'sig/openai/models/audio/transcription_create_params.rbs', line 95
def to_hash: -> {
|