Prerequisites
The following example requires thefal_client library and an API key which can be obtained from Fal.
Example
The following agent will use FAL to generate any video requested by the user.cookbook/tools/fal_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
fal_client library and an API key which can be obtained from Fal.
pip install -U fal_client
export FAL_KEY=***
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.fal import FalTools
fal_agent = Agent(
name="Fal Video Generator Agent",
model=OpenAIChat(id="gpt-4o"),
tools=[FalTools("fal-ai/hunyuan-video")],
description="You are an AI agent that can generate videos using the Fal 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,
debug_mode=True,
show_tool_calls=True,
)
fal_agent.print_response("Generate video of balloon in the ocean")
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | API key for authentication purposes. |
model | str | None | The model to use for the media generation. |
| Function | Description |
|---|---|
generate_media | Generate either images or videos depending on the user prompt. |
image_to_image | Transform an input image based on a text prompt. |
Was this page helpful?