Class: OpenAI::Models::Audio::TranscriptionCreateParams

Inherits:
Internal::Type::BaseModel show all
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

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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, 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, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {}) ⇒ void

Some parameter documentations has been truncated, see OpenAI::Models::Audio::TranscriptionCreateParams for more details.

Parameters:

  • file (Pathname, StringIO, IO, String, OpenAI::FilePart) (defaults to: )

    The audio file object (not file name) to transcribe, in one of these formats: fl

  • model (String, Symbol, OpenAI::Models::AudioModel) (defaults to: )

    ID of the model to use. The options are gpt-4o-transcribe, `gpt-4o-mini-transc

  • chunking_strategy (Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig, nil) (defaults to: nil)

    Controls how the audio is cut into chunks. When set to "auto", the server firs

  • include (Array<Symbol, OpenAI::Models::Audio::TranscriptionInclude>) (defaults to: nil)

    Additional information to include in the transcription response.

  • language (String) (defaults to: nil)

    The language of the input audio. Supplying the input language in [ISO-639-1](htt

  • prompt (String) (defaults to: nil)

    An optional text to guide the model's style or continue a previous audio segment

  • response_format (Symbol, OpenAI::Models::AudioResponseFormat) (defaults to: nil)

    The format of the output, in one of these options: json, text, srt, `verbo

  • temperature (Float) (defaults to: nil)

    The sampling temperature, between 0 and 1. Higher values like 0.8 will make the

  • timestamp_granularities (Array<Symbol, OpenAI::Models::Audio::TranscriptionCreateParams::TimestampGranularity>) (defaults to: nil)

    The timestamp granularities to populate for this transcription. `response_format

  • request_options (OpenAI::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/openai/models/audio/transcription_create_params.rb', line 97

Instance Attribute Details

#chunking_strategySymbol, ...

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.



35
36
37
# File 'lib/openai/models/audio/transcription_create_params.rb', line 35

optional :chunking_strategy,
union: -> { OpenAI::Audio::TranscriptionCreateParams::ChunkingStrategy },
nil?: true

#filePathname, ...

The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.

Returns:



18
# File 'lib/openai/models/audio/transcription_create_params.rb', line 18

required :file, OpenAI::Internal::Type::FileInput

#includeArray<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 and gpt-4o-mini-transcribe.

Returns:



47
# File 'lib/openai/models/audio/transcription_create_params.rb', line 47

optional :include, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionInclude] }

#languageString?

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)


55
# File 'lib/openai/models/audio/transcription_create_params.rb', line 55

optional :language, String

#modelString, ...

ID of the model to use. The options are gpt-4o-transcribe, gpt-4o-mini-transcribe, and whisper-1 (which is powered by our open source Whisper V2 model).

Returns:



26
# File 'lib/openai/models/audio/transcription_create_params.rb', line 26

required :model, union: -> { OpenAI::Audio::TranscriptionCreateParams::Model }

#promptString?

An optional text to guide the model's style or continue a previous audio segment. The prompt should match the audio language.

Returns:

  • (String, nil)


64
# File 'lib/openai/models/audio/transcription_create_params.rb', line 64

optional :prompt, String

#response_formatSymbol, ...

The format of the output, in one of these options: json, text, srt, verbose_json, or vtt. For gpt-4o-transcribe and gpt-4o-mini-transcribe, the only supported format is json.

Returns:



72
# File 'lib/openai/models/audio/transcription_create_params.rb', line 72

optional :response_format, enum: -> { OpenAI::AudioResponseFormat }

#temperatureFloat?

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.

Returns:

  • (Float, nil)


82
# File 'lib/openai/models/audio/transcription_create_params.rb', line 82

optional :temperature, Float

#timestamp_granularitiesArray<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.



92
93
94
95
# File 'lib/openai/models/audio/transcription_create_params.rb', line 92

optional :timestamp_granularities,
-> {
  OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Audio::TranscriptionCreateParams::TimestampGranularity]
}

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/audio/transcription_create_params.rb', line 201

.variantsArray(Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig)



# File 'lib/openai/models/audio/transcription_create_params.rb', line 132