agent_with_media.py
"""
Agent With Media
================
AG-UI agent that accepts multimodal input (images, audio, video, documents).
Uses Google Gemini to analyze attached files. Set GOOGLE_API_KEY env var.
"""
from agno.agent.agent import Agent
from agno.models.google import Gemini
from agno.os import AgentOS
from agno.os.interfaces.agui import AGUI
# ---------------------------------------------------------------------------
# Create Example
# ---------------------------------------------------------------------------
media_agent = Agent(
name="Media Agent",
model=Gemini(id="gemini-2.5-flash"),
instructions="Analyze any image, audio, video, or document the user sends and answer their question about it.",
add_datetime_to_context=True,
markdown=True,
)
# Setup your AgentOS app
# Dojo expects: http://localhost:9001/agentic_chat_multimodal/agui
agent_os = AgentOS(
agents=[media_agent],
interfaces=[AGUI(agent=media_agent, prefix="/agentic_chat_multimodal")],
)
app = agent_os.get_app()
# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------
if __name__ == "__main__":
agent_os.serve(app="agent_with_media:app", port=9001, reload=True)
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Export your API keys
export GOOGLE_API_KEY="your_google_api_key_here"
export JWT_VERIFICATION_KEY="your_jwt_verification_key_here"
$Env:GOOGLE_API_KEY="your_google_api_key_here"
$Env:JWT_VERIFICATION_KEY="your_jwt_verification_key_here"