Prerequisites
You need to install therequests library.
MODELS_LAB_API_KEY environment variable.
Example
The following agent will use ModelsLabs to generate a video based on a text prompt.cookbook/tools/models_labs_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
requests library.
pip install requests
MODELS_LAB_API_KEY environment variable.
export MODELS_LAB_API_KEY=****
from agno.agent import Agent
from agno.tools.models_labs import ModelsLabsTools
# Create an Agent with the ModelsLabs tool
agent = Agent(tools=[ModelsLabsTools()], name="ModelsLabs Agent")
agent.print_response("Generate a video of a beautiful sunset over the ocean", markdown=True)
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | The ModelsLab API key for authentication |
wait_for_completion | bool | False | Whether to wait for the video to be ready |
add_to_eta | int | 15 | Time to add to the ETA to account for the time it takes to fetch the video |
max_wait_time | int | 60 | Maximum time to wait for the video to be ready |
file_type | str | "mp4" | The type of file to generate |
| Function | Description |
|---|---|
generate_media | Generates a video or gif based on a text prompt |
Was this page helpful?