Audio Input (Bytes Content)

Pass raw audio bytes to a Gemini agent with Audio(content=...).

Code

import requests
from agno.agent import Agent
from agno.media import Audio
from agno.models.google import Gemini

agent = Agent(
    model=Gemini(id="gemini-3.5-flash"),
    markdown=True,
)

url = "https://openaiassets.blob.core.windows.net/$web/API/docs/audio/alloy.wav"

# Download the audio file from the URL as bytes
response = requests.get(url, timeout=30)
response.raise_for_status()
audio_content = response.content

agent.print_response(
    "Tell me about this audio",
    audio=[Audio(content=audio_content, format="wav")],
)

Usage

Set up your virtual environment

uv venv --python 3.12
source .venv/bin/activate

Set your API key

export GOOGLE_API_KEY=xxx

Install dependencies

uv pip install -U google-genai requests agno

Run Agent

Save the code above as audio_input_bytes_content.py, then run:

python audio_input_bytes_content.py