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)
| 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)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| 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 logRelease 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 logSecurity 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.
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 logA 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.