Skip to main content

LangChain Wan27 tools

LangChain integration for Wan27 image and video generation. Uses the wan27 Python SDK and langchain-core, without requiring the full LangChain package.

MIT client; paid hosted service. API access requires an active paid Wan27 subscription and generation consumes credits. This package does not provide free model inference.

PyPI publication is pending. For local development, install the root wan27 project first, then this package.

import os
from wan27 import Wan27
from langchain_wan27 import create_wan27_tools

client = Wan27(os.environ["WAN27_ACCESS_TOKEN"])
tools = create_wan27_tools(client)
models_tool = next(t for t in tools if t.name == "wan27_list_models")
print(models_tool.invoke({}))

The default tool set includes account status, model listing, model schema, credit estimation, task listing and task status. Tokens are kept in the client object and are not tool arguments exposed to the model.

To add the wan27_generate_media tool, pass allow_generation=True. This flag does not implement spending approval. Your application must enforce the user's approved budget or a human approval step before invoking generation. Persist request_id and the input before submission. Retry ambiguous submissions only with the same ID; never generate a new ID simply because a network call timed out.

The tools return the service's JSON object. Errors propagate as Wan27Error. A task is only complete when it is succeeded; return actual outputs, not fabricated URLs. Bound polling and report pending task IDs after timeout.

Testing

Install the root package and this adapter in an isolated environment, then run python -m unittest discover -s tests -v in this directory. Tests use a mocked client, validate tool schemas and invocation, and never generate paid media.

Website · Workflow guide · MCP setup · Source

Metadata

Release files for langchain-wan27 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-wan27 0.1.0
File Size Uploaded Provenance Actions
langchain_wan27-0.1.0.tar.gz 3.9 kB With provenance Details for langchain_wan27-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-wan27 0.1.0
File Interpreter ABI Platform Actions
langchain_wan27-0.1.0-py3-none-any.whl Python 3 none any Details for langchain_wan27-0.1.0-py3-none-any.whl

Total release size: 7.9 kB

Release files / langchain_wan27-0.1.0.tar.gz

Download URL langchain_wan27-0.1.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
30ec0589eeb0e8897e957b042731a93eb85ad465967f878c8b2135739e297841
BLAKE2b-256 checksum
How to use checksums
310c6493e1a0411f23fb52fc9ca68ac0d95d7f6bb090dc35e5ef272236da6c08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / langchain_wan27-0.1.0-py3-none-any.whl

Download URL langchain_wan27-0.1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6562a8f490cea0184ebf333a41ec2d051db5eb331b51f7da54a115fc6133c88b
BLAKE2b-256 checksum
How to use checksums
606315749c321c0ace4cc1c6dca4ef4d9789382b48181ec77b579ac6fbcb6053
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for langchain-wan27 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_wan27-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page