ModelsLabs is a video generation tool that allows you to generate videos based on a text prompt.

Create a file models_labs_agent.py with the following code:

models_labs_agent.py
from phi.agent import Agent
from phi.tools.models_labs import ModelsLabs

# Create an Agent with the ModelsLabs tool
agent = Agent(tools=[ModelsLabs()], name="ModelsLabs Agent")

agent.print_response("Generate a video of a beautiful sunset over the ocean", markdown=True)

Usage

1

Create a virtual environment

Open the Terminal and create a python virtual environment.

2

Install libraries

pip install requests
3

Set environment variables

export MODELS_LAB_API_KEY=****
4

Run the agent

python models_labs_agent.py