Examples
Video Generation with Models Lab
Hackathon Resources
- Introduction
- Setup
- Examples
- Simple Text Agent
- Agent with Tools
- Agent with Knowledge
- Agent with Structured Outputs
- Research Agent
- YouTube Agent
- Image Input + Tools
- Image Generation using DALL-E
- Image to Structured Output
- Image Generate Audio
- Image Input + Output
- Image Transcription
- Image search using Giphy
- Audio Input
- Audio Input Output
- Audio Sentiment
- Audio Transcript
- Audio Multi Turn
- Audio Generate Podcast
- Video Input
- Video Generation with Models Lab
- Video Generation with Replicate
- Video Captions
- Video to Shorts
- Models
- Pre-built Replit Template
- 🏆 Prizes
Examples
Video Generation with Models Lab
Generate Video using Models Lab
This agent takes a text input and responds with a video output.
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.models_labs import ModelsLabTools
video_agent = Agent(
model=OpenAIChat(id="gpt-4o"),
tools=[ModelsLabTools()],
description="You are an AI agent that can generate videos using the ModelsLabs API.",
instructions=[
"When the user asks you to create a video, use the `generate_media` tool to create the video.",
"The video will be displayed in the UI automatically below your response, so you don't need to show the video URL in your response.",
"Politely and courteously let the user know that the video has been generated and will be displayed below as soon as its ready.",
],
markdown=True,
debug_mode=True,
show_tool_calls=True,
)
video_agent.print_response("Generate a video of a cat playing with a ball")
Usage
1
Install libraries
pip install -U agno openai
2
Export API keys
export OPENAI_API_KEY=***
export MODELS_LAB_API_KEY=***
3
Run the agent
python video_modelslab.py
On this page