class

Autobot::Transcriber

Inherits Reference < Object

Speech-to-text transcription via Whisper API (OpenAI or Groq).

Usage: transcriber = Transcriber.new(api_key: "sk-...", provider: "openai") text = transcriber.transcribe(audio_bytes, "voice.ogg")

Constants

BOUNDARY = "----AutobotWhisperBoundary"
Log = ::Log.for("transcriber")
PROVIDERS = {"openai" => { url: "https://api.openai.com/v1/audio/transcriptions", model: "whisper-1", }, "groq" => { url: "https://api.groq.com/openai/v1/audio/transcriptions", model: "whisper-large-v3-turbo", }}

Constructors

new(api_key : String, provider : String = "openai")
Source

Class methods

from_config(config : Config::Config) : Transcriber | Nil
Source

Instance methods

provider
Source
transcribe(audio_data : Bytes, filename : String = "voice.ogg") : String | Nil

Transcribe audio data to text. Returns the transcribed text, or nil on failure.

Source