Module: RubyLLM::Providers::Gemini::Transcription

Included in:
RubyLLM::Providers::Gemini
Defined in:
lib/ruby_llm/providers/gemini/transcription.rb

Overview

Audio transcription helpers for the Gemini API implementation

Constant Summary collapse

DEFAULT_PROMPT =
'Transcribe the provided audio and respond with only the transcript text.'

Instance Method Summary collapse

Instance Method Details

#transcribe(audio_file, model:, language:, **options) ⇒ Object



10
11
12
13
14
15
# File 'lib/ruby_llm/providers/gemini/transcription.rb', line 10

def transcribe(audio_file, model:, language:, **options)
  attachment = Attachment.new(audio_file)
  payload = render_transcription_payload(attachment, language:, **options)
  response = @connection.post(transcription_url(model), payload)
  parse_transcription_response(response, model:)
end