transcribe • AI Agent SDK

transcribe: Transcribe audio to text.

transcribe

Method

</div>

This is a method of the AudioAgent class in the audio_agent module.

Transcribe audio to text.

Signature

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

Parameters

ParamField Union[str, BinaryIO]

Path to audio file or file-like object

ParamField Optional[str]

Language code (e.g., “en”, “es”, “fr”)

ParamField Optional[float]

Sampling temperature (0.0 to 1.0)

ParamField Optional[str]

Override model for this call **kwargs: Additional provider-specific parameters

Returns

ResponseField str

Transcribed text

Usage

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

Uses

  • transcription
  • close

Used By

Source

View on GitHub

praisonaiagents/agent/audio_agent.py at line 312