Code
agent_with_media.py
Usage
1
Set up your virtual environment
2
Set your API keys
3
Install dependencies
4
Run Agent
Save the code above as
agent_with_media.py, then run:Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Run a Discord bot that analyzes images, audio, and video using Gemini.
from agno.agent import Agent
from agno.integrations.discord import DiscordClient
from agno.models.google import Gemini
media_agent = Agent(
name="Media Agent",
model=Gemini(id="gemini-3.5-flash"),
description="A Media processing agent",
instructions="Analyze images, audios and videos sent by the user",
add_history_to_context=True,
num_history_runs=3,
add_datetime_to_context=True,
markdown=True,
)
discord_agent = DiscordClient(media_agent)
if __name__ == "__main__":
discord_agent.serve()
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Set your API keys
export GOOGLE_API_KEY=xxx
export DISCORD_BOT_TOKEN=xxx
Install dependencies
uv pip install -U agno google-genai discord.py
Run Agent
agent_with_media.py, then run:python agent_with_media.py
Was this page helpful?