Skip to main content

langchain-tanvo

PyPI license

LangChain tools for Tanvo, an AI image, video and music studio. Give an agent the ability to make images (Nano Banana, Seedream, GPT Image, Qwen, Grok Imagine), short videos with sound (Kling, Veo, Seedance, Wan, MiniMax) and songs (Suno V6), or to run one of 80 ready-made photo apps (pet portraits, figurines, old photo restoration, trend videos) on the user's photos.

  • Works with LangChain 1.x agents (create_agent) and LangGraph.
  • No API key needed to try it: the house image engine runs on Tanvo's free tier.
  • Each tool returns a short text for the model (status, cost, file URLs) and the full run as an artifact for your code.
  • When a setting is rejected, the error lists what the model does accept, so the agent can correct itself.
pip install langchain-tanvo

Tools

Tool Name the model sees What it does
TanvoFindApps tanvo_find_apps Find a ready-made app for what the user wants
TanvoRunApp tanvo_run_app Run an app's preset look on the user's photos
TanvoImageGeneration tanvo_image_generation Text to image, or edit / combine photos
TanvoVideoGeneration tanvo_video_generation Text or image to video, optional end frame and sound
TanvoMusicGeneration tanvo_music_generation A song: describe it, bring lyrics, or go instrumental
TanvoGetGeneration tanvo_get_generation Status and files of an earlier run

TanvoToolkit().get_tools() returns all six, sharing one client.

Setup

export TANVO_API_KEY="sk_..."   # optional; create one at https://tanvo.ai/settings/apikeys

Without a key the tools use Tanvo's anonymous free tier, which runs the house image engine (studio-image-v1) only. A key runs on your account: every model, the same prices as the website, and every run in your history. Failed runs are refunded automatically.

Use with an agent

from langchain.agents import create_agent
from langchain_tanvo import TanvoToolkit

agent = create_agent("anthropic:claude-sonnet-5-5", tools=TanvoToolkit().get_tools())
result = agent.invoke({"messages": [{"role": "user", "content": "Make my dog a royal portrait: https://example.com/rex.jpg"}]})
print(result["messages"][-1].content)

The agent finds the pet portrait app with tanvo_find_apps, runs its royal look with tanvo_run_app and answers with the image URL.

Use a tool directly

from langchain_tanvo import TanvoImageGeneration

tool = TanvoImageGeneration()
print(tool.invoke({"prompt": "a tiny lighthouse on a rocky island at dusk, film photo", "aspect_ratio": "4:3"}))

# As a tool call, to also get the artifact (the full run)
msg = tool.invoke({"type": "tool_call", "name": tool.name, "id": "1", "args": {"prompt": "…", "model": "nano-banana-2", "resolution": "2K"}})
print(msg.content)            # "Done (image, nano-banana-2, 25 credits). Files: - https://media.tanvo.ai/…"
print(msg.artifact["outputs"])

Video waits for the clip by default (usually 1–8 minutes). For long-running agents, return at once and check later:

from langchain_tanvo import TanvoGetGeneration, TanvoVideoGeneration

tools = [TanvoVideoGeneration(wait=False), TanvoGetGeneration()]   # or TanvoToolkit(video_wait=False)

Configuration

Parameter Tools
api_key all Defaults to TANVO_API_KEY
base_url all Defaults to TANVO_BASE_URL, then https://tanvo.ai
client all A tanvo.Client to share between tools
default_model image, video Used when the call names no model (studio-image-v1, studio-video-v1)
wait, timeout video Wait for the clip (default True, 600 s)
limit find apps How many apps to return (default 6)

Models, their options and prices: tanvo.ai/developers/api.

Also from Tanvo

License

MIT

Metadata

Release files for langchain-tanvo 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-tanvo 0.1.0
File Size Uploaded
langchain_tanvo-0.1.0.tar.gz 11.6 kB Details

Built distribution (wheel)

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

Total release size: 21.3 kB

Release files / langchain_tanvo-0.1.0.tar.gz

Download URL langchain_tanvo-0.1.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0c048ceeec15dcebbeec9fb75be0ab9d9d7cd883538afda64c54c2fbcce8cf5f
BLAKE2b-256 checksum
How to use checksums
733d0201c0707b5078de4eef1901ccd0529762c5c1ea9f057a0f67f4896274b5
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 10, 2026.

Transparency log

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

Download URL langchain_tanvo-0.1.0-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fbdffaa2baf91bfc9000f1c43338260d7cb6efae73945757cdaa1797922f267
BLAKE2b-256 checksum
How to use checksums
503c41788098f133280741f1d50026e1cd26e94d313268441a5ddcac2e361dc4
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 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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