Skip to main content

An integration package connecting iLoveVideoEditor and LangChain

Project description

langchain-ilovevideoeditor

PyPI version License: MIT

Render MP4 videos from your LangChain agents with the iLoveVideoEditor cloud rendering API.

The package exposes ILoveVideoEditorTool, a LangChain tool that takes a VideoJSON specification, queues a cloud render, and returns the finished video's download URL.

Installation

pip install -U langchain-ilovevideoeditor

Set your API key (get one from the dashboard):

export ILOVEVIDEOEDITOR_API_KEY="vf_live_..."

Usage

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:

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

With an agent

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

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:

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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_ilovevideoeditor-0.1.0.tar.gz (96.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_ilovevideoeditor-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_ilovevideoeditor-0.1.0.tar.gz.

File metadata

File hashes

Hashes for langchain_ilovevideoeditor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 53c34d61d82b970dc5a544a1bcec7a0e55e4bb32ab16a580c0e11e0f56db837a
MD5 de967dd54c926ddcc5f3e9cc8b4dec6f
BLAKE2b-256 636053f5d91f2725baa5a709c35b2eec09e5ed3a3fe9c605f8152264ce8b6089

See more details on using hashes here.

File details

Details for the file langchain_ilovevideoeditor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_ilovevideoeditor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4944d764e6e197dad7314decab63c3c116f2f7b3a5bb23564d134c84c4414259
MD5 f05ff108bc8553b4ce10e82bb26d3729
BLAKE2b-256 8e880bd32dc326fb082e384af2fc0e9b563911658bed00010716833ef7c43561

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page