llama-index tools ilovevideoeditor integration
Project description
LlamaIndex Tool: iLoveVideoEditor
This tool allows LlamaIndex agents to render MP4 videos from declarative VideoJSON specifications using the iLoveVideoEditor cloud rendering API.
Features
- 🎬 Programmatic video rendering: Turn VideoJSON specs into MP4 videos via a single tool call
- ⏳ Wait or queue: Poll until the render finishes, or queue and check status later
- 🤖 Agent-ready: Works directly with LlamaIndex agents via
BaseToolSpec - 🛡️ Error handling: Graceful error handling with informative messages
Requirements
- Python >= 3.10
- llama-index-core >= 0.13.0
- requests >= 2.31.0
- An iLoveVideoEditor API key (get one from the dashboard)
Installation
pip install llama-index-tools-ilovevideoeditor
Required Environment Variables
ILOVEVIDEOEDITOR_API_KEY=vf_live_...
Usage
from llama_index.tools.ilovevideoeditor import ILoveVideoEditorTool
from llama_index.core.agent import ReActAgent
# Initialize the tool spec (reads ILOVEVIDEOEDITOR_API_KEY from the environment)
tool_spec = ILoveVideoEditorTool()
# Convert the spec to a list of FunctionTools
tools = tool_spec.to_tool_list()
# Create an agent with the rendering tools
agent = ReActAgent.from_tools(tools, verbose=True)
# The agent can now render videos from VideoJSON specs
agent.chat(
"Render a 3-second 1080p video with the text 'Hello from LlamaIndex' "
"using the iLoveVideoEditor tool."
)
Direct usage without an agent:
from llama_index.tools.ilovevideoeditor import ILoveVideoEditorTool
tool = ILoveVideoEditorTool()
result = tool.render_video(
{
"name": "hello",
"layers": [
{
"type": "text",
"settings": {
"startTime": 0,
"duration": 3,
"text": "Hello from LlamaIndex",
"fontSize": 64,
"color": "#ffffff",
},
}
],
}
)
# '{"jobId": "425ba18a-...", "status": "completed", "downloadUrl": "https://..."}'
Queue without waiting, then check status later:
queued = tool.render_video(video_json, wait_for_completion=False)
# '{"jobId": "425ba18a-...", "status": "queued"}'
status = tool.get_render_status("425ba18a-...")
# '{"jobId": "425ba18a-...", "status": "completed", "downloadUrl": "https://..."}'
Configuration options
api_key: API key. Defaults to theILOVEVIDEOEDITOR_API_KEYenvironment variable.base_url: API base URL. Defaults to theILOVEVIDEOEDITOR_API_BASEenvironment variable orhttps://api.ilovevideoeditor.com.max_wait_seconds: Maximum time to poll for render completion (default300).poll_interval_seconds: Interval between status polls (default2).
API reference
For the full VideoJSON schema and REST API reference, see the iLoveVideoEditor API docs.
Examples
See the examples directory for more usage examples.
Development
Run tests:
make test
Run linters:
make lint
Format code:
make format
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_tools_ilovevideoeditor-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_tools_ilovevideoeditor-0.1.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2384c0471bc3f50ce1a0f54c04d2df70100d8bda34fc5e800e49e3a06a89603f
|
|
| MD5 |
0cd9c885666feac5847de184870f5c97
|
|
| BLAKE2b-256 |
03d852a873317b4a8e895cd271df9777d6f917716aa97160f8fdef431c469cc2
|
File details
Details for the file llama_index_tools_ilovevideoeditor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_tools_ilovevideoeditor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee83e06b09ca12699a46f8c7e1d303da09d68fae0af7f9d7f7ce993231402c48
|
|
| MD5 |
98f5387a6654f77defe5f2ee746e89f5
|
|
| BLAKE2b-256 |
ba1295ad769d6c4eec5fec6ce829774af22d48c80a6b567524ecea7c0dbcde1e
|