Code
generate_video_using_replicate.py
Usage
1
Set up your virtual environment
2
Install dependencies
3
Export your OpenAI API key
4
Run Agent
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.replicate import ReplicateTools
"""Create an agent specialized for Replicate AI content generation"""
video_agent = Agent(
name="Video Generator Agent",
model=OpenAIResponses(id="gpt-5.2"),
tools=[
ReplicateTools(
model="tencent/hunyuan-video:847dfa8b01e739637fc76f480ede0c1d76408e1d694b830b5dfb8e547bf98405"
)
],
description="You are an AI agent that can generate videos using the Replicate API.",
instructions=[
"When the user asks you to create a video, use the `generate_media` tool to create the video.",
"Return the URL as raw to the user.",
"Don't convert video URL to markdown or anything else.",
],
markdown=True,
)
video_agent.print_response("Generate a video of a horse in the dessert.")
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Install dependencies
uv pip install -U agno
Export your OpenAI API key
export OPENAI_API_KEY="your_openai_api_key_here"
$Env:OPENAI_API_KEY="your_openai_api_key_here"
Run Agent
python cookbook/03_agents/multimodal/generate_video_using_replicate.py
Was this page helpful?