Skip to main content

langchain-wavespeed

LangChain integration for WaveSpeed AI — run state-of-the-art image and video generation models from your LangChain agents and chains.

Installation

pip install -U langchain-wavespeed

Set your API key (get one at wavespeed.ai):

export WAVESPEED_API_KEY="your-api-key"

Tools

WaveSpeedImageGeneration

Generate images from text prompts (defaults to bytedance/seedream-v5.0-pro):

from langchain_wavespeed import WaveSpeedImageGeneration

tool = WaveSpeedImageGeneration()
url = tool.invoke({"prompt": "A red panda drinking boba tea, studio lighting"})
print(url)  # https://.../output.png

WaveSpeedVideoGeneration

Generate videos from text prompts (defaults to bytedance/seedance-2.5/text-to-video):

from langchain_wavespeed import WaveSpeedVideoGeneration

tool = WaveSpeedVideoGeneration()
url = tool.invoke({"prompt": "A drone shot over a glacier at sunrise", "duration": 5})

WaveSpeedRunModel

Run any model on the WaveSpeed platform by id (browse the catalog at wavespeed.ai/models):

from langchain_wavespeed import WaveSpeedRunModel

tool = WaveSpeedRunModel()
url = tool.invoke({
    "model": "wavespeed-ai/z-image/turbo",
    "input": {"prompt": "A lighthouse at dusk"},
})

Use with an agent

from langchain.agents import create_agent
from langchain_wavespeed import WaveSpeedImageGeneration, WaveSpeedVideoGeneration

agent = create_agent(
    "openai:gpt-5",
    tools=[WaveSpeedImageGeneration(), WaveSpeedVideoGeneration()],
)
result = agent.invoke(
    {"messages": [{"role": "user", "content": "Make me a picture of a corgi surfing."}]}
)

Configuration

All tools accept:

Parameter Default Description
api_key WAVESPEED_API_KEY env var WaveSpeed API key
model tool-specific Model id to run (image/video tools)
timeout None Max seconds to wait for a prediction
poll_interval 1.0 Seconds between result polls

Async is supported out of the box via await tool.ainvoke(...).

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_wavespeed-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_wavespeed-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_wavespeed-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_wavespeed-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for langchain_wavespeed-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ebbf590361e22fcb06a48dd284273e7a804fe37953f5dbcab12daf91cbdcd6f4
MD5 0b7d21089808a5b4db035f4ef24ab66a
BLAKE2b-256 9a6ea401e4848344be8f7425770d7810862f0fae32bf0785f3e71def688081b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_wavespeed-0.1.0.tar.gz:

Publisher: python-publish.yml on WaveSpeedAI/langchain-wavespeed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_wavespeed-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_wavespeed-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b011bd1cae0094434b45a10c7235aee0521472c46445d7f46b190953ee063c7
MD5 c4d1b4ffa1041d828bf48507925e22d1
BLAKE2b-256 1cedfd08607874f37479cb60d10459b7bf8ff8520357344d56cd2e210de4bbab

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_wavespeed-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on WaveSpeedAI/langchain-wavespeed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page