Metadata-Version: 2.4
Name: langchain-ilovevideoeditor
Version: 0.1.0
Summary: An integration package connecting iLoveVideoEditor and LangChain
Project-URL: Homepage, https://ilovevideoeditor.com
Project-URL: Documentation, https://ilovevideoeditor.com/docs/api-guide
Project-URL: Repository, https://github.com/ilovevideoeditor/langchain-ilovevideoeditor
Project-URL: Issues, https://github.com/ilovevideoeditor/langchain-ilovevideoeditor/issues
License: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <4.0.0,>=3.10.0
Requires-Dist: httpx<1.0.0,>=0.27.0
Requires-Dist: langchain-core<2.0.0,>=0.3.0
Description-Content-Type: text/markdown

# langchain-ilovevideoeditor

[![PyPI version](https://img.shields.io/pypi/v/langchain-ilovevideoeditor.svg)](https://pypi.org/project/langchain-ilovevideoeditor/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Render MP4 videos from your LangChain agents with the
[iLoveVideoEditor](https://ilovevideoeditor.com) cloud rendering API.

The package exposes `ILoveVideoEditorTool`, a LangChain tool that takes a
[VideoJSON](https://ilovevideoeditor.com/docs/api-guide) specification, queues a
cloud render, and returns the finished video's download URL.

## Installation

```bash
pip install -U langchain-ilovevideoeditor
```

Set your API key (get one from the
[dashboard](https://ilovevideoeditor.com/dashboard)):

```bash
export ILOVEVIDEOEDITOR_API_KEY="vf_live_..."
```

## Usage

```python
from langchain_ilovevideoeditor import ILoveVideoEditorTool

tool = ILoveVideoEditorTool()

result = tool.invoke({
    "video_json": {
        "name": "hello",
        "layers": [
            {
                "type": "text",
                "settings": {
                    "startTime": 0,
                    "duration": 3,
                    "text": "Hello from LangChain",
                    "fontSize": 64,
                    "color": "#ffffff",
                },
            }
        ],
    }
})
# '{"jobId": "425ba18a-...", "status": "completed", "downloadUrl": "https://..."}'
```

Queue without waiting for the render to finish:

```python
result = tool.invoke({
    "video_json": video_json,
    "wait_for_completion": False,
})
# '{"jobId": "425ba18a-...", "status": "queued"}'
```

### With an agent

```python
from langchain_ilovevideoeditor import ILoveVideoEditorTool

tools = [ILoveVideoEditorTool()]
# pass `tools` to your agent / model.bind_tools(...)
```

### Configuration

| Option | Default | Description |
|---|---|---|
| `api_key` | env `ILOVEVIDEOEDITOR_API_KEY` | API key (required) |
| `base_url` | env `ILOVEVIDEOEDITOR_API_BASE` or `https://api.ilovevideoeditor.com` | API base URL |
| `max_wait_seconds` | `300` | Max time to poll for completion |
| `poll_interval_seconds` | `2` | Interval between status polls |

## Development

```bash
uv sync --group test --group lint
uv run pytest tests/unit_tests
uv run ruff check langchain_ilovevideoeditor tests
```

Integration tests hit the real API and are skipped unless
`ILOVEVIDEOEDITOR_API_KEY` is set:

```bash
ILOVEVIDEOEDITOR_API_KEY=vf_live_... uv run pytest tests/integration_tests
```

## License

MIT
