WaveSpeed Tools
Generate images and videos with WaveSpeedTools and return the raw media URL.
"""
WaveSpeed Tools
=============================
Demonstrates WaveSpeed tools.
"""
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.wavespeed import WaveSpeedTools
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
wavespeed_agent = Agent(
name="WaveSpeed Media Generator Agent",
model=OpenAIResponses(id="gpt-5.5"),
tools=[
WaveSpeedTools(
image_model="bytedance/seedream-v5.0-pro",
video_model="bytedance/seedance-2.5/text-to-video",
)
],
description="You are an AI agent that can generate images and videos using the WaveSpeed API.",
instructions=[
"When the user asks you to create an image, use the `generate_image` tool.",
"When the user asks you to create a video, use the `generate_video` tool.",
"Return the URL as raw to the user.",
"Don't convert the media URL to markdown or anything else.",
],
markdown=True,
)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
wavespeed_agent.print_response(
"Generate an image of a lighthouse on a stormy coast"
)The active request generates an image; the video tool is also enabled. The toolkit returns a ToolResult with image or video artifacts and a message containing their URLs. The agent’s instruction asks the model to present a raw URL. It does not save the media locally. Choose a model that accepts a prompt input; this wrapper sends no other generation parameters.
Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openai wavespeedExport your API keys
export OPENAI_API_KEY="your_openai_api_key_here"
export WAVESPEED_API_KEY="your_wavespeed_api_key_here"Run the example
Save the code above as wavespeed_tools.py, then run:
python wavespeed_tools.pyFull source: cookbook/91_tools/wavespeed_tools.py