Class: Telnyx::Models::AI::AudioTranscribeParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/telnyx/models/ai/audio_transcribe_params.rb

Overview

Defined Under Namespace

Modules: Model, ResponseFormat, TimestampGranularities

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, 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(model:, file: nil, file_url: nil, language: nil, model_config: nil, response_format: nil, timestamp_granularities: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Telnyx::Models::AI::AudioTranscribeParams for more details.

Parameters:

  • model (Symbol, Telnyx::Models::AI::AudioTranscribeParams::Model)

    ID of the model to use. ‘distil-whisper/distil-large-v2` is lower latency but En

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

    The audio file object to transcribe, in one of these formats: flac, mp3, mp4, mp

  • file_url (String) (defaults to: nil)

    Link to audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg

  • language (String) (defaults to: nil)

    The language of the audio to be transcribed. For ‘deepgram/nova-3`, only English

  • model_config (Hash{Symbol=>Object}) (defaults to: nil)

    Additional model-specific configuration parameters. Only allowed with ‘deepgram/

  • response_format (Symbol, Telnyx::Models::AI::AudioTranscribeParams::ResponseFormat) (defaults to: nil)

    The format of the transcript output. Use ‘verbose_json` to take advantage of tim

  • timestamp_granularities (Symbol, Telnyx::Models::AI::AudioTranscribeParams::TimestampGranularities) (defaults to: nil)

    The timestamp granularities to populate for this transcription. ‘response_format

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


# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 73

Instance Attribute Details

#filePathname, ...

The audio file object to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. File uploads are limited to 100 MB. Cannot be used together with ‘file_url`. Note: `deepgram/nova-3` only supports mp3 and wav formats.

Returns:



27
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 27

optional :file, Telnyx::Internal::Type::FileInput

#file_urlString?

Link to audio file in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. Support for hosted files is limited to 100MB. Cannot be used together with ‘file`. Note: `deepgram/nova-3` only supports mp3 and wav formats.

Returns:

  • (String, nil)


35
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 35

optional :file_url, String

#languageString?

The language of the audio to be transcribed. For ‘deepgram/nova-3`, only English variants are supported: `en`, `en-US`, `en-GB`, `en-AU`, `en-NZ`, `en-IN`. For `openai/whisper-large-v3-turbo`, supports multiple languages. `distil-whisper/distil-large-v2` does not support language parameter.

Returns:

  • (String, nil)


44
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 44

optional :language, String

#modelSymbol, Telnyx::Models::AI::AudioTranscribeParams::Model

ID of the model to use. ‘distil-whisper/distil-large-v2` is lower latency but English-only. `openai/whisper-large-v3-turbo` is multi-lingual but slightly higher latency. `deepgram/nova-3` supports English variants (en, en-US, en-GB, en-AU, en-NZ, en-IN) and only accepts mp3/wav files.



18
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 18

required :model, enum: -> { Telnyx::AI::AudioTranscribeParams::Model }

#model_configHash{Symbol=>Object}?

Additional model-specific configuration parameters. Only allowed with ‘deepgram/nova-3` model. Can include Deepgram-specific options such as `smart_format`, `punctuate`, `diarize`, `utterance`, `numerals`, and `language`. If `language` is provided both as a top-level parameter and in `model_config`, the top-level parameter takes precedence.

Returns:

  • (Hash{Symbol=>Object}, nil)


54
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 54

optional :model_config, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]

#response_formatSymbol, ...

The format of the transcript output. Use ‘verbose_json` to take advantage of timestamps.



61
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 61

optional :response_format, enum: -> { Telnyx::AI::AudioTranscribeParams::ResponseFormat }

#timestamp_granularitiesSymbol, ...

The timestamp granularities to populate for this transcription. ‘response_format` must be set verbose_json to use timestamp granularities. Currently `segment` is supported.



69
70
71
# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 69

optional :timestamp_granularities,
enum: -> { Telnyx::AI::AudioTranscribeParams::TimestampGranularities },
api_name: :"timestamp_granularities[]"

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/telnyx/models/ai/audio_transcribe_params.rb', line 104