Skip to main content

transcribe

Method
This is a method of the AudioAgent class in the audio_agent module.
Transcribe audio to text.

Signature

def transcribe(file: Union[str, BinaryIO], language: Optional[str], temperature: Optional[float], model: Optional[str]) -> str

Parameters

file
Union
required
Path to audio file or file-like object
language
Optional
Language code (e.g., “en”, “es”, “fr”)
temperature
Optional
Sampling temperature (0.0 to 1.0)
model
Optional
Override model for this call **kwargs: Additional provider-specific parameters

Returns

Returns
str
Transcribed text

Usage

agent = AudioAgent(llm="openai/whisper-1")
    text = agent.transcribe("audio.mp3")
    print(text)