Class: Telnyx::Resources::AI::Audio

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/ai/audio.rb,
sig/telnyx/resources/ai/audio.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Audio

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Audio.

Parameters:



50
51
52
# File 'lib/telnyx/resources/ai/audio.rb', line 50

def initialize(client:)
  @client = client
end

Instance Method Details

#transcribe(model:, file: nil, file_url: nil, language: nil, model_config: nil, response_format: nil, timestamp_granularities: nil, request_options: {}) ⇒ Telnyx::Models::AI::AudioTranscribeResponse

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

Transcribe speech to text. This endpoint is consistent with the OpenAI Transcription API and may be used with the OpenAI JS or Python SDK.

Parameters:

Returns:

See Also:



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/telnyx/resources/ai/audio.rb', line 35

def transcribe(params)
  parsed, options = Telnyx::AI::AudioTranscribeParams.dump_request(params)
  @client.request(
    method: :post,
    path: "ai/audio/transcriptions",
    headers: {"content-type" => "multipart/form-data"},
    body: parsed,
    model: Telnyx::Models::AI::AudioTranscribeResponse,
    options: options
  )
end