Code

cookbook/models/google/gemini/video_agent.py
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,
)

# Please download "GreatRedSpot.mp4" using
# wget https://storage.googleapis.com/generativeai-downloads/images/GreatRedSpot.mp4
video_path = Path(__file__).parent.joinpath("GreatRedSpot.mp4")

agent.print_response("Tell me about this video", videos=[Video(filepath=video_path)])

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.

2

Set your API key

export GOOGLE_API_KEY=xxx
3

Install libraries

pip install -U google-generativeai agno
4

Download sample video

wget https://storage.googleapis.com/generativeai-downloads/images/GreatRedSpot.mp4
5

Run Agent