Hackathon Resources
Models
Gemini
Gemini models support text, audio, images and videos as input.
1
Setup your virtual environment
python3 -m venv .venv
source .venv/bin/activate
2
Install dependencies
pip install -U google-genai duckduckgo-search agno
3
Export your Google API key
export GOOGLE_API_KEY=***
4
Run the agent
python agent.py
Example: Audio Agent
from agno.agent import Agent
from agno.media import Audio
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
url = "https://openaiassets.blob.core.windows.net/$web/API/docs/audio/alloy.wav"
agent.print_response(
"Tell me about this audio",
audio=[Audio(url=url)],
)
Example: Image Agent
from agno.agent import Agent
from agno.media import Image
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
tools=[DuckDuckGoTools()],
markdown=True,
)
agent.print_response(
"Tell me about this image and search the web for more information.",
images=[
Image(
url="https://upload.wikimedia.org/wikipedia/commons/0/0c/GoldenGateBridge-001.jpg"
),
],
)
Example: Video Agent
from pathlib import Path
from agno.agent import Agent
from agno.media import Video
from agno.models.google import Gemini
agent = Agent(
model=Gemini(id="gemini-2.0-flash-exp"),
markdown=True,
)
# Run: `wget https://storage.googleapis.com/generativeai-downloads/images/GreatRedSpot.mp4` to download a sample video
video_path = Path(__file__).parent.joinpath("sample_video.mp4")
agent.print_response("Tell me about this video?", videos=[Video(filepath=video_path)])