Code
cookbook/apps/discord/agent_with_media.py
Usage
1
Create a virtual environment
Open the
Terminal and create a python virtual environment.2
Set your API keys
3
Install libraries
4
Run Agent
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
from agno.agent import Agent
from agno.app.discord import DiscordClient
from agno.models.google import Gemini
media_agent = Agent(
name="Media Agent",
model=Gemini(id="gemini-2.0-flash"),
description="A Media processing agent",
instructions="Analyze images, audios and videos sent by the user",
add_history_to_messages=True,
num_history_responses=3,
add_datetime_to_instructions=True,
markdown=True,
)
discord_agent = DiscordClient(media_agent)
if __name__ == "__main__":
discord_agent.serve()
Create a virtual environment
Terminal and create a python virtual environment.python3 -m venv .venv
source .venv/bin/activate
python3 -m venv .venv
.venv/scripts/activate
Set your API keys
export GOOGLE_API_KEY=xxx
export DISCORD_BOT_TOKEN=xxx
Install libraries
pip install -U agno google-generativeai discord.py
Run Agent
python cookbook/apps/discord/agent_with_media.py
python cookbook/apps/discord/agent_with_media.py
Was this page helpful?