Skip to main content
The source passes a Google uploaded File object to Audio.content, which accepts bytes in Agno v2.7.4. Use the local file path directly before running.
audio_input_file_upload.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export your Google API key

4

Use the local audio directly

Remove the UploadFileConfig import and the remote file lookup and upload block. Replace Audio(content=audio_file) with Audio(filepath=audio_path).
5

Add the sample audio

Place an MP3 named sample.mp3 next to the saved script, or update audio_path to point to your audio file.
6

Run the example

Save the code above as audio_input_file_upload.py, then run:
Full source: cookbook/90_models/google/gemini/audio_input_file_upload.py