Metadata-Version: 2.4
Name: vap-langchain
Version: 0.2.1
Summary: VAP LangChain integration - Execution control for agents calling paid APIs
Project-URL: Homepage, https://vapagent.com
Project-URL: Documentation, https://api.vapagent.com/docs
Project-URL: Repository, https://github.com/elestirelbilinc-sketch/vap-showcase
Author-email: VAP Team <hello@vapagent.com>
License-Expression: MIT
Keywords: agents,ai,cost-control,execution-control,langchain,vap
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: langchain-core>=0.1.0
Requires-Dist: vap-sdk>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Description-Content-Type: text/markdown

# VAP LangChain Tools

**Execution control for LangChain agents calling paid APIs.**

LangChain tools for VAP - the execution control layer. Enforce cost limits and deterministic retries when your chains generate video, music, and images.

## Installation

```bash
pip install vap-langchain
```

## Quick Start

```python
from langchain.agents import initialize_agent, AgentType
from langchain_openai import ChatOpenAI
from vap_langchain import VapProductionTool

# Initialize tools
vap_tool = VapProductionTool(api_key="vap_your_api_key")

# Create agent
llm = ChatOpenAI(model="gpt-4")
agent = initialize_agent(
    tools=[vap_tool],
    llm=llm,
    agent=AgentType.OPENAI_FUNCTIONS,
)

# Run
result = agent.run("Create an energetic startup launch video with upbeat music")
print(result)
```

## Available Tools

| Tool | Description | Cost |
|------|-------------|------|
| `VapProductionTool` | Full production (video + music + thumbnail) | $5.90 |
| `VapVideoTool` | Single video | $1.96 |
| `VapMusicTool` | Single music track | $0.68 |
| `VapImageTool` | Single image | $0.18 |

## Recommended: VapProductionTool

For most use cases, use `VapProductionTool`. It creates everything in one call:

```python
from vap_langchain import VapProductionTool

tool = VapProductionTool(api_key="vap_...")

# Agent will automatically use this for any media request
result = tool.run("Cozy coffee shop morning scene with gentle acoustic vibes")
# Returns: Video URL, Music URL, Thumbnail URL
```

## With LangGraph

```python
from langgraph.graph import StateGraph
from vap_langchain import VapProductionTool

vap = VapProductionTool(api_key="vap_...")

def produce_media(state):
    result = vap.run(state["prompt"])
    return {"media": result}

# Add to your graph
graph.add_node("producer", produce_media)
```

## Budget Safety

VAP uses a prepaid model - your agent can't overspend. The tool will return an error if balance is insufficient, preventing runaway costs.

## Links

- [VAP Documentation](https://api.vapagent.com/docs)
- [VAP SDK](https://pypi.org/project/vap-sdk/)
- [GitHub](https://github.com/elestirelbilinc-sketch/vap-showcase)