crewai-videogen 2.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- crewai_videogen/__init__.py +18 -0
- crewai_videogen/client.py +47 -0
- crewai_videogen/operations.py +88 -0
- crewai_videogen/toolkit.py +46 -0
- crewai_videogen/tools.py +1018 -0
- crewai_videogen-2.5.3.dist-info/METADATA +119 -0
- crewai_videogen-2.5.3.dist-info/RECORD +8 -0
- crewai_videogen-2.5.3.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""Official CrewAI tools for the VideoGen API."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
from .client import resolve_client
|
|
6
|
+
from .operations import Controls
|
|
7
|
+
from .toolkit import create_videogen_tools
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"Controls",
|
|
11
|
+
"create_videogen_tools",
|
|
12
|
+
"resolve_client",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
__version__ = version("crewai-videogen")
|
|
17
|
+
except PackageNotFoundError:
|
|
18
|
+
__version__ = "0.0.0"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# AUTO-GENERATED from api/integrations/python-agent-templates/client.py. DO NOT EDIT.
|
|
2
|
+
"""Client resolution for the VideoGen CrewAI integration."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from videogen import VideoGen
|
|
10
|
+
|
|
11
|
+
_DEFAULT_BASE_URL = "https://api.videogen.io"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def resolve_client(
|
|
15
|
+
client: Optional[VideoGen] = None,
|
|
16
|
+
*,
|
|
17
|
+
api_key: Optional[str] = None,
|
|
18
|
+
base_url: Optional[str] = None,
|
|
19
|
+
) -> VideoGen:
|
|
20
|
+
"""Resolve a VideoGen client from an explicit client, an explicit key, or the environment.
|
|
21
|
+
|
|
22
|
+
Every tool call is authenticated as the team that owns the key.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
client: A pre-configured ``VideoGen`` client. Used as-is when provided.
|
|
26
|
+
api_key: API key. Falls back to the ``VIDEOGEN_API_KEY`` environment variable.
|
|
27
|
+
base_url: API base URL. Falls back to ``VIDEOGEN_BASE_URL``, then production.
|
|
28
|
+
"""
|
|
29
|
+
if client is not None:
|
|
30
|
+
return client
|
|
31
|
+
|
|
32
|
+
resolved_key = api_key or os.environ.get("VIDEOGEN_API_KEY")
|
|
33
|
+
|
|
34
|
+
if resolved_key is None or resolved_key.strip() == "":
|
|
35
|
+
raise ValueError(
|
|
36
|
+
"No VideoGen API key found. Pass `client` or `api_key`, or set the "
|
|
37
|
+
"VIDEOGEN_API_KEY environment variable. Create a key at "
|
|
38
|
+
"https://app.videogen.io/api."
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
resolved_base_url = base_url or os.environ.get("VIDEOGEN_BASE_URL") or _DEFAULT_BASE_URL
|
|
42
|
+
|
|
43
|
+
return VideoGen(
|
|
44
|
+
api_key=resolved_key.strip(),
|
|
45
|
+
base_url=resolved_base_url,
|
|
46
|
+
client_id="crewai",
|
|
47
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# AUTO-GENERATED from api/integrations/python-agent-templates/operations.py. DO NOT EDIT.
|
|
2
|
+
"""Shared helpers for starting and polling VideoGen operations."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
from typing import Any, Callable, Dict, Optional
|
|
8
|
+
|
|
9
|
+
from videogen import VideoGen
|
|
10
|
+
from videogen.poll_executed_tool import poll_executed_tool
|
|
11
|
+
from videogen.poll_project_export import poll_project_export
|
|
12
|
+
from videogen.poll_workflow_run import poll_workflow_run
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class Controls:
|
|
17
|
+
"""How the tools handle asynchronous VideoGen operations."""
|
|
18
|
+
|
|
19
|
+
wait: bool = True
|
|
20
|
+
poll_interval_ms: Optional[int] = None
|
|
21
|
+
timeout_ms: Optional[int] = None
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def to_dict(obj: Any) -> Any:
|
|
25
|
+
"""Convert an SDK response model into a plain, JSON-serializable structure."""
|
|
26
|
+
model_dump = getattr(obj, "model_dump", None)
|
|
27
|
+
if callable(model_dump):
|
|
28
|
+
return model_dump(mode="json")
|
|
29
|
+
return obj
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def drop_none(values: Dict[str, Any]) -> Dict[str, Any]:
|
|
33
|
+
"""Drop ``None``-valued keys so the SDK applies its own defaults."""
|
|
34
|
+
return {key: value for key, value in values.items() if value is not None}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _poll_kwargs(controls: Controls) -> Dict[str, int]:
|
|
38
|
+
kwargs: Dict[str, int] = {}
|
|
39
|
+
if controls.poll_interval_ms is not None:
|
|
40
|
+
kwargs["poll_interval_ms"] = controls.poll_interval_ms
|
|
41
|
+
if controls.timeout_ms is not None:
|
|
42
|
+
kwargs["timeout_ms"] = controls.timeout_ms
|
|
43
|
+
return kwargs
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def run_workflow(
|
|
47
|
+
client: VideoGen,
|
|
48
|
+
controls: Controls,
|
|
49
|
+
start: Callable[[], Any],
|
|
50
|
+
) -> Any:
|
|
51
|
+
"""Start a workflow and, unless ``wait`` is False, poll it to a terminal state."""
|
|
52
|
+
started = start()
|
|
53
|
+
if not controls.wait:
|
|
54
|
+
return to_dict(started)
|
|
55
|
+
|
|
56
|
+
run = poll_workflow_run(client, started["workflowRunId"], **_poll_kwargs(controls))
|
|
57
|
+
return to_dict(run)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def run_tool(
|
|
61
|
+
client: VideoGen,
|
|
62
|
+
controls: Controls,
|
|
63
|
+
start: Callable[[], Any],
|
|
64
|
+
) -> Any:
|
|
65
|
+
"""Start a media tool execution and, unless ``wait`` is False, poll it to a terminal state."""
|
|
66
|
+
started = start()
|
|
67
|
+
if not controls.wait:
|
|
68
|
+
return to_dict(started)
|
|
69
|
+
|
|
70
|
+
execution = poll_executed_tool(client, started["toolExecutionId"], **_poll_kwargs(controls))
|
|
71
|
+
return to_dict(execution)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def run_export(
|
|
75
|
+
client: VideoGen,
|
|
76
|
+
controls: Controls,
|
|
77
|
+
project_id: str,
|
|
78
|
+
start: Callable[[], Any],
|
|
79
|
+
) -> Any:
|
|
80
|
+
"""Start a project export and, unless ``wait`` is False, poll until the download URL is ready."""
|
|
81
|
+
started = start()
|
|
82
|
+
if not controls.wait:
|
|
83
|
+
return to_dict(started)
|
|
84
|
+
|
|
85
|
+
project_export = poll_project_export(
|
|
86
|
+
client, project_id, started["exportId"], **_poll_kwargs(controls)
|
|
87
|
+
)
|
|
88
|
+
return to_dict(project_export)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Factory for the VideoGen CrewAI integration."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable, List, Optional
|
|
6
|
+
|
|
7
|
+
from crewai.tools import BaseTool
|
|
8
|
+
from videogen import VideoGen
|
|
9
|
+
|
|
10
|
+
from .client import resolve_client
|
|
11
|
+
from .operations import Controls
|
|
12
|
+
from .tools import build_videogen_tools
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def create_videogen_tools(
|
|
16
|
+
client: Optional[VideoGen] = None,
|
|
17
|
+
*,
|
|
18
|
+
api_key: Optional[str] = None,
|
|
19
|
+
base_url: Optional[str] = None,
|
|
20
|
+
wait: bool = True,
|
|
21
|
+
poll_interval_ms: Optional[int] = None,
|
|
22
|
+
timeout_ms: Optional[int] = None,
|
|
23
|
+
include: Optional[Iterable[str]] = None,
|
|
24
|
+
) -> List[BaseTool]:
|
|
25
|
+
"""Build VideoGen tools in CrewAI format, ready to pass to an ``Agent`` or ``Crew``.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
client: A pre-configured ``VideoGen`` client. When omitted, one is built
|
|
29
|
+
from ``api_key`` / ``base_url`` or the ``VIDEOGEN_API_KEY`` environment variable.
|
|
30
|
+
wait: When True (default), tools block until the workflow run or tool execution
|
|
31
|
+
finishes and return the completed result. Set False to return immediately
|
|
32
|
+
with the run/execution id for the caller to poll.
|
|
33
|
+
poll_interval_ms: Poll interval while waiting. Defaults to the SDK's default.
|
|
34
|
+
timeout_ms: Maximum time to wait before giving up. Defaults to the SDK's default.
|
|
35
|
+
include: Restrict the returned tool set to these tool names. Defaults to all tools.
|
|
36
|
+
"""
|
|
37
|
+
resolved_client = resolve_client(client, api_key=api_key, base_url=base_url)
|
|
38
|
+
controls = Controls(wait=wait, poll_interval_ms=poll_interval_ms, timeout_ms=timeout_ms)
|
|
39
|
+
|
|
40
|
+
tools = build_videogen_tools(resolved_client, controls)
|
|
41
|
+
|
|
42
|
+
if include is None:
|
|
43
|
+
return tools
|
|
44
|
+
|
|
45
|
+
included = set(include)
|
|
46
|
+
return [tool for tool in tools if tool.name in included]
|
crewai_videogen/tools.py
ADDED
|
@@ -0,0 +1,1018 @@
|
|
|
1
|
+
# AUTO-GENERATED by api/scripts/generate-python-agent-integrations.ts. DO NOT EDIT.
|
|
2
|
+
# Run `pnpm --filter api exec tsx scripts/generate-python-agent-integrations.ts` to regenerate.
|
|
3
|
+
"""VideoGen tools in CrewAI format."""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from typing import Any, Dict, Iterable, List, Literal, Optional
|
|
7
|
+
|
|
8
|
+
from crewai.tools import BaseTool
|
|
9
|
+
from crewai.tools import tool as _crewai_tool
|
|
10
|
+
from videogen import VideoGen
|
|
11
|
+
from videogen.get_hydrated_file import get_hydrated_file
|
|
12
|
+
from videogen.upload_file import upload_file as _upload_file
|
|
13
|
+
|
|
14
|
+
from .operations import Controls, drop_none, run_export, run_tool, run_workflow, to_dict
|
|
15
|
+
|
|
16
|
+
ModelQuality = Literal["LOW", "STANDARD", "HIGH", "MAX"]
|
|
17
|
+
ExportProjectQuality = Literal["STANDARD", "HIGH", "FULL_HIGH", "ULTRA_HIGH"]
|
|
18
|
+
FileType = Literal["IMAGE", "VIDEO", "AUDIO", "PDF", "SLIDESHOW", "TEXT", "LOTTIE"]
|
|
19
|
+
WatermarkMode = Literal["NONE", "VIDEO_GEN", "AUTO"]
|
|
20
|
+
EndScreenMode = Literal["NONE", "VIDEO_GEN", "AUTO"]
|
|
21
|
+
VisualPacing = Literal["FAST", "MEDIUM", "SLOW"]
|
|
22
|
+
|
|
23
|
+
GENERATED_TOOL_NAMES = frozenset(
|
|
24
|
+
{
|
|
25
|
+
"cancel_tool_execution",
|
|
26
|
+
"cancel_workflow_run",
|
|
27
|
+
"export_project",
|
|
28
|
+
"generate_avatar",
|
|
29
|
+
"generate_image",
|
|
30
|
+
"generate_motion_graphic",
|
|
31
|
+
"generate_music",
|
|
32
|
+
"generate_sound_effect",
|
|
33
|
+
"generate_video_clip",
|
|
34
|
+
"get_file",
|
|
35
|
+
"list_files",
|
|
36
|
+
"get_me",
|
|
37
|
+
"get_project",
|
|
38
|
+
"get_tool_execution",
|
|
39
|
+
"get_workflow_run",
|
|
40
|
+
"image_3d_effect",
|
|
41
|
+
"list_languages",
|
|
42
|
+
"list_project_remix_actions",
|
|
43
|
+
"list_projects",
|
|
44
|
+
"list_tool_executions",
|
|
45
|
+
"list_tts_voices",
|
|
46
|
+
"list_workflow_runs",
|
|
47
|
+
"prompt_to_video_clip",
|
|
48
|
+
"remix_project",
|
|
49
|
+
"remove_image_background",
|
|
50
|
+
"remove_video_background",
|
|
51
|
+
"script_to_video",
|
|
52
|
+
"slideshow_to_video",
|
|
53
|
+
"storyboard_to_video",
|
|
54
|
+
"text_to_speech",
|
|
55
|
+
"upload_file",
|
|
56
|
+
"upscale_image",
|
|
57
|
+
"upscale_video",
|
|
58
|
+
"vectorize_image",
|
|
59
|
+
"video_to_video",
|
|
60
|
+
"voiceover_to_video",
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def build_videogen_tools(client: VideoGen, controls: Controls) -> List[BaseTool]:
|
|
66
|
+
"""Build the OpenAPI-derived VideoGen tools bound to client and controls."""
|
|
67
|
+
tools: List[BaseTool] = []
|
|
68
|
+
|
|
69
|
+
def register(func: Any, name: str, description: str) -> None:
|
|
70
|
+
func.__doc__ = description
|
|
71
|
+
tools.append(_crewai_tool(name)(func))
|
|
72
|
+
|
|
73
|
+
def cancel_tool_execution(
|
|
74
|
+
tool_execution_id: str,
|
|
75
|
+
) -> Any:
|
|
76
|
+
return to_dict(client.tools.cancel_tool_execution(**drop_none(
|
|
77
|
+
{
|
|
78
|
+
"tool_execution_id": tool_execution_id,
|
|
79
|
+
}
|
|
80
|
+
)))
|
|
81
|
+
|
|
82
|
+
register(
|
|
83
|
+
cancel_tool_execution,
|
|
84
|
+
"cancel_tool_execution",
|
|
85
|
+
"Request cancellation of a running tool execution. The execution transitions to `cancelled` if it has not already completed.",
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
def cancel_workflow_run(
|
|
89
|
+
workflow_run_id: str,
|
|
90
|
+
) -> Any:
|
|
91
|
+
return to_dict(client.workflows.cancel_workflow_run(**drop_none(
|
|
92
|
+
{
|
|
93
|
+
"workflow_run_id": workflow_run_id,
|
|
94
|
+
}
|
|
95
|
+
)))
|
|
96
|
+
|
|
97
|
+
register(
|
|
98
|
+
cancel_workflow_run,
|
|
99
|
+
"cancel_workflow_run",
|
|
100
|
+
"Cancel a workflow run",
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
def export_project(
|
|
104
|
+
project_id: str,
|
|
105
|
+
quality: Optional[ExportProjectQuality] = None,
|
|
106
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
107
|
+
end_screen_mode: Optional[EndScreenMode] = None,
|
|
108
|
+
delivery_destinations: Optional[List[Dict[str, Any]]] = None,
|
|
109
|
+
) -> Any:
|
|
110
|
+
return run_export(
|
|
111
|
+
client,
|
|
112
|
+
controls,
|
|
113
|
+
project_id,
|
|
114
|
+
lambda: client.projects.export_project(**drop_none(
|
|
115
|
+
{
|
|
116
|
+
"project_id": project_id,
|
|
117
|
+
"quality": quality,
|
|
118
|
+
"watermark_mode": watermark_mode,
|
|
119
|
+
"end_screen_mode": end_screen_mode,
|
|
120
|
+
"delivery_destinations": delivery_destinations,
|
|
121
|
+
}
|
|
122
|
+
)),
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
register(
|
|
126
|
+
export_project,
|
|
127
|
+
"export_project",
|
|
128
|
+
"Starts an export of a project to MP4. Returns immediately with an export id; the file becomes available when the export task completes. Exporting requires a paid plan in the app, but the API lets you export for free with a VideoGen watermark and a short 'Made with VideoGen' end screen appended to the video. A Pro plan lets you remove both by setting `watermarkMode` and `endScreenMode` to `NONE`.",
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
def generate_avatar(
|
|
132
|
+
actor_entity_id: str,
|
|
133
|
+
audio_file_id: str,
|
|
134
|
+
avatar_quality: Optional[ModelQuality] = None,
|
|
135
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
136
|
+
num_results: Optional[int] = None,
|
|
137
|
+
is_output_temporary: Optional[bool] = None,
|
|
138
|
+
) -> Any:
|
|
139
|
+
return run_tool(
|
|
140
|
+
client,
|
|
141
|
+
controls,
|
|
142
|
+
lambda: client.tools.generate_avatar(**drop_none(
|
|
143
|
+
{
|
|
144
|
+
"actor_entity_id": actor_entity_id,
|
|
145
|
+
"audio_file_id": audio_file_id,
|
|
146
|
+
"avatar_quality": avatar_quality,
|
|
147
|
+
"watermark_mode": watermark_mode,
|
|
148
|
+
"num_results": num_results,
|
|
149
|
+
"is_output_temporary": is_output_temporary,
|
|
150
|
+
}
|
|
151
|
+
)),
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
register(
|
|
155
|
+
generate_avatar,
|
|
156
|
+
"generate_avatar",
|
|
157
|
+
"Generate a talking-head avatar video from uploaded audio. Prefer actor_entity_id and provide exactly one avatar source.",
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
def generate_image(
|
|
161
|
+
prompt: str,
|
|
162
|
+
image_file_ids: Optional[List[str]] = None,
|
|
163
|
+
entity_ids: Optional[List[str]] = None,
|
|
164
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
165
|
+
quality: Optional[ModelQuality] = None,
|
|
166
|
+
content_policy_config: Optional[Dict[str, Any]] = None,
|
|
167
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
168
|
+
num_results: Optional[int] = None,
|
|
169
|
+
is_output_temporary: Optional[bool] = None,
|
|
170
|
+
) -> Any:
|
|
171
|
+
return run_tool(
|
|
172
|
+
client,
|
|
173
|
+
controls,
|
|
174
|
+
lambda: client.tools.generate_image(**drop_none(
|
|
175
|
+
{
|
|
176
|
+
"prompt": prompt,
|
|
177
|
+
"image_file_ids": image_file_ids,
|
|
178
|
+
"entity_ids": entity_ids,
|
|
179
|
+
"aspect_ratio": aspect_ratio,
|
|
180
|
+
"quality": quality,
|
|
181
|
+
"content_policy_config": content_policy_config,
|
|
182
|
+
"watermark_mode": watermark_mode,
|
|
183
|
+
"num_results": num_results,
|
|
184
|
+
"is_output_temporary": is_output_temporary,
|
|
185
|
+
}
|
|
186
|
+
)),
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
register(
|
|
190
|
+
generate_image,
|
|
191
|
+
"generate_image",
|
|
192
|
+
"Generate an image from a text prompt, optionally guided by reference images and actor, product, or visual-style entity ids. When reference images are provided, the prompt describes the desired transformation. VideoGen automatically routes each request to the most effective state-of-the-art image model for your prompt, reference images, entities, and quality tier, so you don't pick a model.",
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
def generate_motion_graphic(
|
|
196
|
+
prompt: str,
|
|
197
|
+
file_ids: Optional[List[str]] = None,
|
|
198
|
+
entity_ids: Optional[List[str]] = None,
|
|
199
|
+
duration_seconds: Optional[int] = None,
|
|
200
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
201
|
+
transparent_background: Optional[bool] = None,
|
|
202
|
+
sub_tool_modes: Optional[Dict[str, Any]] = None,
|
|
203
|
+
num_results: Optional[int] = None,
|
|
204
|
+
is_output_temporary: Optional[bool] = None,
|
|
205
|
+
) -> Any:
|
|
206
|
+
return run_tool(
|
|
207
|
+
client,
|
|
208
|
+
controls,
|
|
209
|
+
lambda: client.tools.generate_motion_graphic(**drop_none(
|
|
210
|
+
{
|
|
211
|
+
"prompt": prompt,
|
|
212
|
+
"file_ids": file_ids,
|
|
213
|
+
"entity_ids": entity_ids,
|
|
214
|
+
"duration_seconds": duration_seconds,
|
|
215
|
+
"aspect_ratio": aspect_ratio,
|
|
216
|
+
"transparent_background": transparent_background,
|
|
217
|
+
"sub_tool_modes": sub_tool_modes,
|
|
218
|
+
"num_results": num_results,
|
|
219
|
+
"is_output_temporary": is_output_temporary,
|
|
220
|
+
}
|
|
221
|
+
)),
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
register(
|
|
225
|
+
generate_motion_graphic,
|
|
226
|
+
"generate_motion_graphic",
|
|
227
|
+
"Generate an animated motion graphic video from a text prompt. This is an experimental, fully agentic alternative to a video workflow: VideoGen plans the animation, optionally generates or fetches supporting media, and renders a self-contained animated clip. It is especially well suited to precise text animations (e.g. a typing effect, animated captions, kinetic typography, lower thirds) that are hard to express with stock or generated footage. Optionally pass uploaded `fileIds` for reference media and `entityIds` for actors, products, or visual styles the animation should use. This endpoint returns one standalone video. For longer, narrated, multi-scene videos, use a video workflow such as [Script to video](/workflows) (`POST /v1/workflows/script-to-video`) instead.",
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
def generate_music(
|
|
231
|
+
prompt: str,
|
|
232
|
+
num_results: Optional[int] = None,
|
|
233
|
+
is_output_temporary: Optional[bool] = None,
|
|
234
|
+
) -> Any:
|
|
235
|
+
return run_tool(
|
|
236
|
+
client,
|
|
237
|
+
controls,
|
|
238
|
+
lambda: client.tools.generate_music(**drop_none(
|
|
239
|
+
{
|
|
240
|
+
"prompt": prompt,
|
|
241
|
+
"num_results": num_results,
|
|
242
|
+
"is_output_temporary": is_output_temporary,
|
|
243
|
+
}
|
|
244
|
+
)),
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
register(
|
|
248
|
+
generate_music,
|
|
249
|
+
"generate_music",
|
|
250
|
+
"Generate an instrumental music track from a text description. The returned track is approximately 30 seconds long. VideoGen automatically routes each request to the most effective state-of-the-art music model for your prompt, so you don't pick a model.",
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
def generate_sound_effect(
|
|
254
|
+
prompt: str,
|
|
255
|
+
duration_seconds: Optional[float] = None,
|
|
256
|
+
prompt_influence: Optional[float] = None,
|
|
257
|
+
num_results: Optional[int] = None,
|
|
258
|
+
is_output_temporary: Optional[bool] = None,
|
|
259
|
+
) -> Any:
|
|
260
|
+
return run_tool(
|
|
261
|
+
client,
|
|
262
|
+
controls,
|
|
263
|
+
lambda: client.tools.generate_sound_effect(**drop_none(
|
|
264
|
+
{
|
|
265
|
+
"prompt": prompt,
|
|
266
|
+
"duration_seconds": duration_seconds,
|
|
267
|
+
"prompt_influence": prompt_influence,
|
|
268
|
+
"num_results": num_results,
|
|
269
|
+
"is_output_temporary": is_output_temporary,
|
|
270
|
+
}
|
|
271
|
+
)),
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
register(
|
|
275
|
+
generate_sound_effect,
|
|
276
|
+
"generate_sound_effect",
|
|
277
|
+
"Generate a sound effect from a text description. Optionally control the duration and prompt influence. VideoGen automatically routes each request to the most effective state-of-the-art sound effect model for your prompt and settings, so you don't pick a model.",
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
def generate_video_clip(
|
|
281
|
+
prompt: Optional[str] = None,
|
|
282
|
+
start_frame_file_id: Optional[str] = None,
|
|
283
|
+
image_file_ids: Optional[List[str]] = None,
|
|
284
|
+
video_file_ids: Optional[List[str]] = None,
|
|
285
|
+
audio_file_ids: Optional[List[str]] = None,
|
|
286
|
+
spoken_dialogue: Optional[str] = None,
|
|
287
|
+
voice_description: Optional[str] = None,
|
|
288
|
+
generate_audio: Optional[bool] = None,
|
|
289
|
+
suppress_background_music: Optional[bool] = None,
|
|
290
|
+
duration_seconds: Optional[int] = None,
|
|
291
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
292
|
+
quality: Optional[ModelQuality] = None,
|
|
293
|
+
content_policy_config: Optional[Dict[str, Any]] = None,
|
|
294
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
295
|
+
num_results: Optional[int] = None,
|
|
296
|
+
is_output_temporary: Optional[bool] = None,
|
|
297
|
+
) -> Any:
|
|
298
|
+
return run_tool(
|
|
299
|
+
client,
|
|
300
|
+
controls,
|
|
301
|
+
lambda: client.tools.generate_video_clip(**drop_none(
|
|
302
|
+
{
|
|
303
|
+
"prompt": prompt,
|
|
304
|
+
"start_frame_file_id": start_frame_file_id,
|
|
305
|
+
"image_file_ids": image_file_ids,
|
|
306
|
+
"video_file_ids": video_file_ids,
|
|
307
|
+
"audio_file_ids": audio_file_ids,
|
|
308
|
+
"spoken_dialogue": spoken_dialogue,
|
|
309
|
+
"voice_description": voice_description,
|
|
310
|
+
"generate_audio": generate_audio,
|
|
311
|
+
"suppress_background_music": suppress_background_music,
|
|
312
|
+
"duration_seconds": duration_seconds,
|
|
313
|
+
"aspect_ratio": aspect_ratio,
|
|
314
|
+
"quality": quality,
|
|
315
|
+
"content_policy_config": content_policy_config,
|
|
316
|
+
"watermark_mode": watermark_mode,
|
|
317
|
+
"num_results": num_results,
|
|
318
|
+
"is_output_temporary": is_output_temporary,
|
|
319
|
+
}
|
|
320
|
+
)),
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
register(
|
|
324
|
+
generate_video_clip,
|
|
325
|
+
"generate_video_clip",
|
|
326
|
+
"Generate a single short video clip (up to 30 seconds) from a text prompt, optionally guided by an opening-frame still, reference images, videos, and audio. At least one of `prompt`, `startFrameFileId`, `imageFileIds`, `videoFileIds`, `audioFileIds`, or `spokenDialogue` must be provided. VideoGen automatically routes each request to the most effective state-of-the-art video model for your inputs and settings, so you don't pick a model. This endpoint returns one standalone clip. For longer, higher-quality, professionally edited videos with narration, captions, music, and multiple scenes, use a video workflow such as [Script to video](/workflows) (`POST /v1/workflows/script-to-video`) instead.",
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
def get_file(
|
|
330
|
+
file_id: str,
|
|
331
|
+
) -> Any:
|
|
332
|
+
return to_dict(get_hydrated_file(client, file_id))
|
|
333
|
+
|
|
334
|
+
register(
|
|
335
|
+
get_file,
|
|
336
|
+
"get_file",
|
|
337
|
+
"Fetch a file by id with freshly hydrated signed URLs for its available renditions.",
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
def list_files(
|
|
341
|
+
limit: Optional[int] = None,
|
|
342
|
+
cursor: Optional[str] = None,
|
|
343
|
+
self_only: Optional[bool] = None,
|
|
344
|
+
include_export_files: Optional[bool] = None,
|
|
345
|
+
include_project_files: Optional[bool] = None,
|
|
346
|
+
) -> Any:
|
|
347
|
+
return to_dict(client.files.get_files(**drop_none(
|
|
348
|
+
{
|
|
349
|
+
"limit": limit,
|
|
350
|
+
"cursor": cursor,
|
|
351
|
+
"self_only": self_only,
|
|
352
|
+
"include_export_files": include_export_files,
|
|
353
|
+
"include_project_files": include_project_files,
|
|
354
|
+
}
|
|
355
|
+
)))
|
|
356
|
+
|
|
357
|
+
register(
|
|
358
|
+
list_files,
|
|
359
|
+
"list_files",
|
|
360
|
+
"List files accessible to your team. By default this returns standalone files (direct tool-call outputs and uploads) and omits two categories: export files (the raw output files of your exports) and project files (the generative files created within a project, e.g. each AI image and text-to-speech file in a script-to-video workflow output). Set `includeExportFiles` and/or `includeProjectFiles` to true to include them. Use `selfOnly=true` to restrict results to files created by the calling API key's user. Files are returned most recently updated first. Cursor-paginated; see the [Pagination](/pagination) guide.",
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
def get_me() -> Any:
|
|
364
|
+
return to_dict(client.account.get_me())
|
|
365
|
+
|
|
366
|
+
register(
|
|
367
|
+
get_me,
|
|
368
|
+
"get_me",
|
|
369
|
+
"Return the account and team behind the API key making the request. Takes no parameters. Call it as a connection test to confirm a key is valid and to discover the `teamId` and account `email` a key belongs to.",
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
def get_project(
|
|
373
|
+
project_id: str,
|
|
374
|
+
) -> Any:
|
|
375
|
+
return to_dict(client.projects.get_project(**drop_none(
|
|
376
|
+
{
|
|
377
|
+
"project_id": project_id,
|
|
378
|
+
}
|
|
379
|
+
)))
|
|
380
|
+
|
|
381
|
+
register(
|
|
382
|
+
get_project,
|
|
383
|
+
"get_project",
|
|
384
|
+
"Returns a simplified view of a project including its title, aspect ratio, status, and URL.",
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
def get_tool_execution(
|
|
388
|
+
tool_execution_id: str,
|
|
389
|
+
) -> Any:
|
|
390
|
+
return to_dict(client.tools.get_tool_execution_info(**drop_none(
|
|
391
|
+
{
|
|
392
|
+
"tool_execution_id": tool_execution_id,
|
|
393
|
+
}
|
|
394
|
+
)))
|
|
395
|
+
|
|
396
|
+
register(
|
|
397
|
+
get_tool_execution,
|
|
398
|
+
"get_tool_execution",
|
|
399
|
+
"Retrieve the current status and result of a tool execution. Poll this endpoint until `status` is `succeeded`, `failed`, or `cancelled`. Each succeeded result carries signed `downloadUrl`/`thumbnailUrl` (with matching `*ExpiresAt` timestamps) alongside the full hydrated `file`. The signed URLs are private and valid for 7 days; this single-execution endpoint automatically re-signs them when they are within an hour of expiring, so a caller always receives a URL valid long enough to use. Results remain retrievable indefinitely, including executions older than 7 days. Note that list endpoints (e.g. `GET /v1/tools/executions`) do not re-sign URLs: they return the last-signed URL, which may already be expired (check `downloadUrlExpiresAt`). To refresh a URL, GET the individual execution here, or hydrate the file directly via `GET /v1/files/{fileId}` / `POST /v1/files/{fileId}/hydrate`.",
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
def get_workflow_run(
|
|
403
|
+
workflow_run_id: str,
|
|
404
|
+
) -> Any:
|
|
405
|
+
return to_dict(client.workflows.get_workflow_run(**drop_none(
|
|
406
|
+
{
|
|
407
|
+
"workflow_run_id": workflow_run_id,
|
|
408
|
+
}
|
|
409
|
+
)))
|
|
410
|
+
|
|
411
|
+
register(
|
|
412
|
+
get_workflow_run,
|
|
413
|
+
"get_workflow_run",
|
|
414
|
+
"Get workflow run status",
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
def image_3d_effect(
|
|
418
|
+
image_file_id: str,
|
|
419
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
420
|
+
num_results: Optional[int] = None,
|
|
421
|
+
is_output_temporary: Optional[bool] = None,
|
|
422
|
+
) -> Any:
|
|
423
|
+
return run_tool(
|
|
424
|
+
client,
|
|
425
|
+
controls,
|
|
426
|
+
lambda: client.tools.image3d_effect(**drop_none(
|
|
427
|
+
{
|
|
428
|
+
"image_file_id": image_file_id,
|
|
429
|
+
"watermark_mode": watermark_mode,
|
|
430
|
+
"num_results": num_results,
|
|
431
|
+
"is_output_temporary": is_output_temporary,
|
|
432
|
+
}
|
|
433
|
+
)),
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
register(
|
|
437
|
+
image_3d_effect,
|
|
438
|
+
"image_3d_effect",
|
|
439
|
+
"Turn a still image into a short video clip with a 3D parallax motion effect, simulating camera movement through the scene.",
|
|
440
|
+
)
|
|
441
|
+
|
|
442
|
+
def list_languages(
|
|
443
|
+
query: Optional[str] = None,
|
|
444
|
+
) -> Any:
|
|
445
|
+
return to_dict(client.resources.list_languages(**drop_none(
|
|
446
|
+
{
|
|
447
|
+
"query": query,
|
|
448
|
+
}
|
|
449
|
+
)))
|
|
450
|
+
|
|
451
|
+
register(
|
|
452
|
+
list_languages,
|
|
453
|
+
"list_languages",
|
|
454
|
+
"List the languages a project can be translated into. Pass a `languageCode` from the response to the `TRANSLATE_PROJECT` remix action. Returns the full catalogue in a single response (not paginated). Pass `query` to filter by language code or English name.",
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
def list_project_remix_actions(
|
|
458
|
+
project_id: str,
|
|
459
|
+
limit: Optional[int] = None,
|
|
460
|
+
cursor: Optional[str] = None,
|
|
461
|
+
) -> Any:
|
|
462
|
+
return to_dict(client.projects.list_project_remix_actions(**drop_none(
|
|
463
|
+
{
|
|
464
|
+
"project_id": project_id,
|
|
465
|
+
"limit": limit,
|
|
466
|
+
"cursor": cursor,
|
|
467
|
+
}
|
|
468
|
+
)))
|
|
469
|
+
|
|
470
|
+
register(
|
|
471
|
+
list_project_remix_actions,
|
|
472
|
+
"list_project_remix_actions",
|
|
473
|
+
"Returns remix actions applied to a project (via `POST /v1/projects/{projectId}/remix` or as a post-workflow step), most recent first, with each action's status and progress. Cursor-paginated; see the [Pagination](/pagination) guide.",
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
def list_projects(
|
|
477
|
+
limit: Optional[int] = None,
|
|
478
|
+
cursor: Optional[str] = None,
|
|
479
|
+
self_only: Optional[bool] = None,
|
|
480
|
+
) -> Any:
|
|
481
|
+
return to_dict(client.projects.list_projects(**drop_none(
|
|
482
|
+
{
|
|
483
|
+
"limit": limit,
|
|
484
|
+
"cursor": cursor,
|
|
485
|
+
"self_only": self_only,
|
|
486
|
+
}
|
|
487
|
+
)))
|
|
488
|
+
|
|
489
|
+
register(
|
|
490
|
+
list_projects,
|
|
491
|
+
"list_projects",
|
|
492
|
+
"Returns projects, most recently updated first, including projects created in the dashboard. Use `selfOnly=true` to restrict results to the calling API key's user; otherwise all matching projects for the team are returned. Cursor-paginated; see the [Pagination](/pagination) guide.",
|
|
493
|
+
)
|
|
494
|
+
|
|
495
|
+
def list_tool_executions(
|
|
496
|
+
limit: Optional[int] = None,
|
|
497
|
+
cursor: Optional[str] = None,
|
|
498
|
+
self_only: Optional[bool] = None,
|
|
499
|
+
) -> Any:
|
|
500
|
+
return to_dict(client.tools.list_tool_executions(**drop_none(
|
|
501
|
+
{
|
|
502
|
+
"limit": limit,
|
|
503
|
+
"cursor": cursor,
|
|
504
|
+
"self_only": self_only,
|
|
505
|
+
}
|
|
506
|
+
)))
|
|
507
|
+
|
|
508
|
+
register(
|
|
509
|
+
list_tool_executions,
|
|
510
|
+
"list_tool_executions",
|
|
511
|
+
"List tool executions started via the API, most recently created first. Use `selfOnly=true` to restrict results to the calling API key's user; otherwise all executions for the team are returned. Cursor-paginated; see the [Pagination](/pagination) guide. Executions remain listable indefinitely (including those older than 7 days). For efficiency this list does not re-sign result download URLs, so `downloadUrl`/`thumbnailUrl` reflect the last time they were signed and may be expired (always check `downloadUrlExpiresAt`). To obtain a fresh signed URL, GET the individual execution (`GET /v1/tools/executions/{toolExecutionId}`) or hydrate the file (`GET /v1/files/{fileId}` / `POST /v1/files/{fileId}/hydrate`).",
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
def list_tts_voices(
|
|
515
|
+
limit: Optional[int] = None,
|
|
516
|
+
cursor: Optional[str] = None,
|
|
517
|
+
include_deprecated_voices: Optional[bool] = None,
|
|
518
|
+
query: Optional[str] = None,
|
|
519
|
+
) -> Any:
|
|
520
|
+
return to_dict(client.resources.list_tts_voices(**drop_none(
|
|
521
|
+
{
|
|
522
|
+
"limit": limit,
|
|
523
|
+
"cursor": cursor,
|
|
524
|
+
"include_deprecated_voices": include_deprecated_voices,
|
|
525
|
+
"query": query,
|
|
526
|
+
}
|
|
527
|
+
)))
|
|
528
|
+
|
|
529
|
+
register(
|
|
530
|
+
list_tts_voices,
|
|
531
|
+
"list_tts_voices",
|
|
532
|
+
"List available text-to-speech voices. Pass a `voiceId` or `displayName` from the response to the text-to-speech endpoint. Cursor-paginated; see the [Pagination](/pagination) guide. Pass `query` to filter by voice id, display name, language, accent, or description.",
|
|
533
|
+
)
|
|
534
|
+
|
|
535
|
+
def list_workflow_runs(
|
|
536
|
+
limit: Optional[int] = None,
|
|
537
|
+
cursor: Optional[str] = None,
|
|
538
|
+
self_only: Optional[bool] = None,
|
|
539
|
+
) -> Any:
|
|
540
|
+
return to_dict(client.workflows.list_workflow_runs(**drop_none(
|
|
541
|
+
{
|
|
542
|
+
"limit": limit,
|
|
543
|
+
"cursor": cursor,
|
|
544
|
+
"self_only": self_only,
|
|
545
|
+
}
|
|
546
|
+
)))
|
|
547
|
+
|
|
548
|
+
register(
|
|
549
|
+
list_workflow_runs,
|
|
550
|
+
"list_workflow_runs",
|
|
551
|
+
"List workflow runs started via the API, most recently created first. Use `selfOnly=true` to restrict results to the calling API key's user; otherwise all runs for the team are returned. Cursor-paginated; see the [Pagination](/pagination) guide.",
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
def prompt_to_video_clip(
|
|
555
|
+
prompt: str,
|
|
556
|
+
image_file_ids: Optional[List[str]] = None,
|
|
557
|
+
duration_seconds: Optional[int] = None,
|
|
558
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
559
|
+
quality: Optional[ModelQuality] = None,
|
|
560
|
+
is_output_temporary: Optional[bool] = None,
|
|
561
|
+
auto_export: Optional[bool] = None,
|
|
562
|
+
export_options: Optional[Dict[str, Any]] = None,
|
|
563
|
+
) -> Any:
|
|
564
|
+
return run_workflow(
|
|
565
|
+
client,
|
|
566
|
+
controls,
|
|
567
|
+
lambda: client.workflows.prompt_to_video_clip(**drop_none(
|
|
568
|
+
{
|
|
569
|
+
"prompt": prompt,
|
|
570
|
+
"image_file_ids": image_file_ids,
|
|
571
|
+
"duration_seconds": duration_seconds,
|
|
572
|
+
"aspect_ratio": aspect_ratio,
|
|
573
|
+
"quality": quality,
|
|
574
|
+
"is_output_temporary": is_output_temporary,
|
|
575
|
+
"auto_export": auto_export,
|
|
576
|
+
"export_options": export_options,
|
|
577
|
+
}
|
|
578
|
+
)),
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
register(
|
|
582
|
+
prompt_to_video_clip,
|
|
583
|
+
"prompt_to_video_clip",
|
|
584
|
+
"Creates a project from a text prompt and generates one short AI video clip (up to 30 seconds). VideoGen first generates an opening frame from the prompt (optionally guided by reference images), then animates that frame into a video. Returns immediately with a workflow run id; poll or subscribe to webhooks for completion. For a standalone clip without an editable project, use `POST /v1/tools/generate-video-clip` instead. For longer narrated multi-scene videos, use `POST /v1/workflows/script-to-video`. The generated clip is clamped to the selected quality's supported range.",
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
def remix_project(
|
|
588
|
+
project_id: str,
|
|
589
|
+
remix_actions: List[Dict[str, Any]],
|
|
590
|
+
save_as_new_project: Optional[bool] = None,
|
|
591
|
+
) -> Any:
|
|
592
|
+
return to_dict(client.projects.remix_project(**drop_none(
|
|
593
|
+
{
|
|
594
|
+
"project_id": project_id,
|
|
595
|
+
"remix_actions": remix_actions,
|
|
596
|
+
"save_as_new_project": save_as_new_project,
|
|
597
|
+
}
|
|
598
|
+
)))
|
|
599
|
+
|
|
600
|
+
register(
|
|
601
|
+
remix_project,
|
|
602
|
+
"remix_project",
|
|
603
|
+
"Applies an ordered list of edits (background music, logo overlay, caption visibility/style) to a project. Each action runs asynchronously as its own remix action; the response returns one remix action id per action in order. Set `saveAsNewProject` to apply the edits to a copy and leave the original untouched. Poll `GET /v1/projects/{projectId}/remix-actions` for status.",
|
|
604
|
+
)
|
|
605
|
+
|
|
606
|
+
def remove_image_background(
|
|
607
|
+
image_file_id: str,
|
|
608
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
609
|
+
num_results: Optional[int] = None,
|
|
610
|
+
is_output_temporary: Optional[bool] = None,
|
|
611
|
+
) -> Any:
|
|
612
|
+
return run_tool(
|
|
613
|
+
client,
|
|
614
|
+
controls,
|
|
615
|
+
lambda: client.tools.remove_image_background(**drop_none(
|
|
616
|
+
{
|
|
617
|
+
"image_file_id": image_file_id,
|
|
618
|
+
"watermark_mode": watermark_mode,
|
|
619
|
+
"num_results": num_results,
|
|
620
|
+
"is_output_temporary": is_output_temporary,
|
|
621
|
+
}
|
|
622
|
+
)),
|
|
623
|
+
)
|
|
624
|
+
|
|
625
|
+
register(
|
|
626
|
+
remove_image_background,
|
|
627
|
+
"remove_image_background",
|
|
628
|
+
"Remove the background from an image, returning a transparent-background PNG of the foreground subject.",
|
|
629
|
+
)
|
|
630
|
+
|
|
631
|
+
def remove_video_background(
|
|
632
|
+
video_file_id: str,
|
|
633
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
634
|
+
num_results: Optional[int] = None,
|
|
635
|
+
is_output_temporary: Optional[bool] = None,
|
|
636
|
+
) -> Any:
|
|
637
|
+
return run_tool(
|
|
638
|
+
client,
|
|
639
|
+
controls,
|
|
640
|
+
lambda: client.tools.remove_video_background(**drop_none(
|
|
641
|
+
{
|
|
642
|
+
"video_file_id": video_file_id,
|
|
643
|
+
"watermark_mode": watermark_mode,
|
|
644
|
+
"num_results": num_results,
|
|
645
|
+
"is_output_temporary": is_output_temporary,
|
|
646
|
+
}
|
|
647
|
+
)),
|
|
648
|
+
)
|
|
649
|
+
|
|
650
|
+
register(
|
|
651
|
+
remove_video_background,
|
|
652
|
+
"remove_video_background",
|
|
653
|
+
"Remove the background from a video, producing a transparent-background video of the foreground subject.",
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
def script_to_video(
|
|
657
|
+
script: str,
|
|
658
|
+
visual_style: Dict[str, Any],
|
|
659
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
660
|
+
visual_pacing: Optional[VisualPacing] = None,
|
|
661
|
+
quality: Optional[ModelQuality] = None,
|
|
662
|
+
language: Optional[str] = None,
|
|
663
|
+
voice_id: Optional[str] = None,
|
|
664
|
+
voice_speed: Optional[float] = None,
|
|
665
|
+
actor_entity_id: Optional[str] = None,
|
|
666
|
+
avatar_quality: Optional[ModelQuality] = None,
|
|
667
|
+
featured_broll_file_ids: Optional[List[str]] = None,
|
|
668
|
+
workflow_agent_context: Optional[str] = None,
|
|
669
|
+
scenes: Optional[List[Dict[str, Any]]] = None,
|
|
670
|
+
remix_actions: Optional[List[Dict[str, Any]]] = None,
|
|
671
|
+
is_output_temporary: Optional[bool] = None,
|
|
672
|
+
auto_export: Optional[bool] = None,
|
|
673
|
+
export_options: Optional[Dict[str, Any]] = None,
|
|
674
|
+
) -> Any:
|
|
675
|
+
return run_workflow(
|
|
676
|
+
client,
|
|
677
|
+
controls,
|
|
678
|
+
lambda: client.workflows.script_to_video(**drop_none(
|
|
679
|
+
{
|
|
680
|
+
"script": script,
|
|
681
|
+
"visual_style": visual_style,
|
|
682
|
+
"aspect_ratio": aspect_ratio,
|
|
683
|
+
"visual_pacing": visual_pacing,
|
|
684
|
+
"quality": quality,
|
|
685
|
+
"language": language,
|
|
686
|
+
"voice_id": voice_id,
|
|
687
|
+
"voice_speed": voice_speed,
|
|
688
|
+
"actor_entity_id": actor_entity_id,
|
|
689
|
+
"avatar_quality": avatar_quality,
|
|
690
|
+
"featured_broll_file_ids": featured_broll_file_ids,
|
|
691
|
+
"workflow_agent_context": workflow_agent_context,
|
|
692
|
+
"scenes": scenes,
|
|
693
|
+
"remix_actions": remix_actions,
|
|
694
|
+
"is_output_temporary": is_output_temporary,
|
|
695
|
+
"auto_export": auto_export,
|
|
696
|
+
"export_options": export_options,
|
|
697
|
+
}
|
|
698
|
+
)),
|
|
699
|
+
)
|
|
700
|
+
|
|
701
|
+
register(
|
|
702
|
+
script_to_video,
|
|
703
|
+
"script_to_video",
|
|
704
|
+
"Turn a script into a narrated video. The script is narrated verbatim. Provide at least two remix_actions for a polished result.",
|
|
705
|
+
)
|
|
706
|
+
|
|
707
|
+
def slideshow_to_video(
|
|
708
|
+
file_id: str,
|
|
709
|
+
slide_scripts: Optional[List[str]] = None,
|
|
710
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
711
|
+
language: Optional[str] = None,
|
|
712
|
+
voice_id: Optional[str] = None,
|
|
713
|
+
voice_speed: Optional[float] = None,
|
|
714
|
+
actor_entity_id: Optional[str] = None,
|
|
715
|
+
avatar_quality: Optional[ModelQuality] = None,
|
|
716
|
+
slideshow_theme_entity_id: Optional[str] = None,
|
|
717
|
+
caption_style: Optional[Dict[str, Any]] = None,
|
|
718
|
+
logo_file_id: Optional[str] = None,
|
|
719
|
+
remix_actions: Optional[List[Dict[str, Any]]] = None,
|
|
720
|
+
is_output_temporary: Optional[bool] = None,
|
|
721
|
+
auto_export: Optional[bool] = None,
|
|
722
|
+
export_options: Optional[Dict[str, Any]] = None,
|
|
723
|
+
) -> Any:
|
|
724
|
+
return run_workflow(
|
|
725
|
+
client,
|
|
726
|
+
controls,
|
|
727
|
+
lambda: client.workflows.slideshow_to_video(**drop_none(
|
|
728
|
+
{
|
|
729
|
+
"file_id": file_id,
|
|
730
|
+
"slide_scripts": slide_scripts,
|
|
731
|
+
"aspect_ratio": aspect_ratio,
|
|
732
|
+
"language": language,
|
|
733
|
+
"voice_id": voice_id,
|
|
734
|
+
"voice_speed": voice_speed,
|
|
735
|
+
"actor_entity_id": actor_entity_id,
|
|
736
|
+
"avatar_quality": avatar_quality,
|
|
737
|
+
"slideshow_theme_entity_id": slideshow_theme_entity_id,
|
|
738
|
+
"caption_style": caption_style,
|
|
739
|
+
"logo_file_id": logo_file_id,
|
|
740
|
+
"remix_actions": remix_actions,
|
|
741
|
+
"is_output_temporary": is_output_temporary,
|
|
742
|
+
"auto_export": auto_export,
|
|
743
|
+
"export_options": export_options,
|
|
744
|
+
}
|
|
745
|
+
)),
|
|
746
|
+
)
|
|
747
|
+
|
|
748
|
+
register(
|
|
749
|
+
slideshow_to_video,
|
|
750
|
+
"slideshow_to_video",
|
|
751
|
+
"Build a narrated video from an uploaded PDF or slideshow. Provide at least two remix_actions for a polished result.",
|
|
752
|
+
)
|
|
753
|
+
|
|
754
|
+
def storyboard_to_video(
|
|
755
|
+
scenes: List[Dict[str, Any]],
|
|
756
|
+
actor_entity_ids: Optional[List[str]] = None,
|
|
757
|
+
product_entity_ids: Optional[List[str]] = None,
|
|
758
|
+
default_generation: Optional[Dict[str, Any]] = None,
|
|
759
|
+
default_duration_seconds: Optional[int] = None,
|
|
760
|
+
quality: Optional[ModelQuality] = None,
|
|
761
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
762
|
+
workflow_agent_context: Optional[str] = None,
|
|
763
|
+
remix_actions: Optional[List[Dict[str, Any]]] = None,
|
|
764
|
+
is_output_temporary: Optional[bool] = None,
|
|
765
|
+
auto_export: Optional[bool] = None,
|
|
766
|
+
export_options: Optional[Dict[str, Any]] = None,
|
|
767
|
+
) -> Any:
|
|
768
|
+
return run_workflow(
|
|
769
|
+
client,
|
|
770
|
+
controls,
|
|
771
|
+
lambda: client.request(
|
|
772
|
+
method="POST",
|
|
773
|
+
path="/v1/workflows/storyboard-to-video",
|
|
774
|
+
body=dict(**drop_none(
|
|
775
|
+
{
|
|
776
|
+
"scenes": scenes,
|
|
777
|
+
"actor_entity_ids": actor_entity_ids,
|
|
778
|
+
"product_entity_ids": product_entity_ids,
|
|
779
|
+
"default_generation": default_generation,
|
|
780
|
+
"default_duration_seconds": default_duration_seconds,
|
|
781
|
+
"quality": quality,
|
|
782
|
+
"aspect_ratio": aspect_ratio,
|
|
783
|
+
"workflow_agent_context": workflow_agent_context,
|
|
784
|
+
"remix_actions": remix_actions,
|
|
785
|
+
"is_output_temporary": is_output_temporary,
|
|
786
|
+
"auto_export": auto_export,
|
|
787
|
+
"export_options": export_options,
|
|
788
|
+
}
|
|
789
|
+
)),
|
|
790
|
+
),
|
|
791
|
+
)
|
|
792
|
+
|
|
793
|
+
register(
|
|
794
|
+
storyboard_to_video,
|
|
795
|
+
"storyboard_to_video",
|
|
796
|
+
"Build a video from structured scenes. Provide at least two remix_actions, such as ENABLE_CAPTIONS and ADD_TRANSITIONS.",
|
|
797
|
+
)
|
|
798
|
+
|
|
799
|
+
def text_to_speech(
|
|
800
|
+
tts_text: str,
|
|
801
|
+
voice_id: str,
|
|
802
|
+
speech_language_code: Optional[str] = None,
|
|
803
|
+
pronunciation_replacements: Optional[List[Dict[str, Any]]] = None,
|
|
804
|
+
auto_expand_pronunciation_replacements: Optional[bool] = None,
|
|
805
|
+
voice_speed: Optional[float] = None,
|
|
806
|
+
num_results: Optional[int] = None,
|
|
807
|
+
is_output_temporary: Optional[bool] = None,
|
|
808
|
+
) -> Any:
|
|
809
|
+
return run_tool(
|
|
810
|
+
client,
|
|
811
|
+
controls,
|
|
812
|
+
lambda: client.tools.text_to_speech(**drop_none(
|
|
813
|
+
{
|
|
814
|
+
"tts_text": tts_text,
|
|
815
|
+
"voice_id": voice_id,
|
|
816
|
+
"speech_language_code": speech_language_code,
|
|
817
|
+
"pronunciation_replacements": pronunciation_replacements,
|
|
818
|
+
"auto_expand_pronunciation_replacements": auto_expand_pronunciation_replacements,
|
|
819
|
+
"voice_speed": voice_speed,
|
|
820
|
+
"num_results": num_results,
|
|
821
|
+
"is_output_temporary": is_output_temporary,
|
|
822
|
+
}
|
|
823
|
+
)),
|
|
824
|
+
)
|
|
825
|
+
|
|
826
|
+
register(
|
|
827
|
+
text_to_speech,
|
|
828
|
+
"text_to_speech",
|
|
829
|
+
"Convert text into a spoken audio file. Only voices with `supportsDirectToolExecution` set to true can be used. Optionally choose a voice, language, speed, and pronunciation overrides.",
|
|
830
|
+
)
|
|
831
|
+
|
|
832
|
+
def upload_file(
|
|
833
|
+
file_path: str,
|
|
834
|
+
display_name: Optional[str] = None,
|
|
835
|
+
type: Optional[FileType] = None,
|
|
836
|
+
) -> Any:
|
|
837
|
+
resolved_name = display_name or os.path.basename(file_path)
|
|
838
|
+
with open(file_path, "rb") as handle:
|
|
839
|
+
uploaded = _upload_file(
|
|
840
|
+
client,
|
|
841
|
+
handle,
|
|
842
|
+
display_name=resolved_name,
|
|
843
|
+
**drop_none({"type": type}),
|
|
844
|
+
)
|
|
845
|
+
return to_dict(uploaded)
|
|
846
|
+
|
|
847
|
+
register(
|
|
848
|
+
upload_file,
|
|
849
|
+
"upload_file",
|
|
850
|
+
"Upload a local file to VideoGen and wait until it is processed. Returns its file_id for workflows, tools, entities, logos, or B-roll.",
|
|
851
|
+
)
|
|
852
|
+
|
|
853
|
+
def upscale_image(
|
|
854
|
+
image_file_id: str,
|
|
855
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
856
|
+
num_results: Optional[int] = None,
|
|
857
|
+
is_output_temporary: Optional[bool] = None,
|
|
858
|
+
) -> Any:
|
|
859
|
+
return run_tool(
|
|
860
|
+
client,
|
|
861
|
+
controls,
|
|
862
|
+
lambda: client.tools.upscale_image(**drop_none(
|
|
863
|
+
{
|
|
864
|
+
"image_file_id": image_file_id,
|
|
865
|
+
"watermark_mode": watermark_mode,
|
|
866
|
+
"num_results": num_results,
|
|
867
|
+
"is_output_temporary": is_output_temporary,
|
|
868
|
+
}
|
|
869
|
+
)),
|
|
870
|
+
)
|
|
871
|
+
|
|
872
|
+
register(
|
|
873
|
+
upscale_image,
|
|
874
|
+
"upscale_image",
|
|
875
|
+
"Increase the resolution of an image while preserving detail and sharpness.",
|
|
876
|
+
)
|
|
877
|
+
|
|
878
|
+
def upscale_video(
|
|
879
|
+
video_file_id: str,
|
|
880
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
881
|
+
num_results: Optional[int] = None,
|
|
882
|
+
is_output_temporary: Optional[bool] = None,
|
|
883
|
+
) -> Any:
|
|
884
|
+
return run_tool(
|
|
885
|
+
client,
|
|
886
|
+
controls,
|
|
887
|
+
lambda: client.tools.upscale_video(**drop_none(
|
|
888
|
+
{
|
|
889
|
+
"video_file_id": video_file_id,
|
|
890
|
+
"watermark_mode": watermark_mode,
|
|
891
|
+
"num_results": num_results,
|
|
892
|
+
"is_output_temporary": is_output_temporary,
|
|
893
|
+
}
|
|
894
|
+
)),
|
|
895
|
+
)
|
|
896
|
+
|
|
897
|
+
register(
|
|
898
|
+
upscale_video,
|
|
899
|
+
"upscale_video",
|
|
900
|
+
"Increase the resolution of a video while preserving detail and sharpness.",
|
|
901
|
+
)
|
|
902
|
+
|
|
903
|
+
def vectorize_image(
|
|
904
|
+
image_file_id: str,
|
|
905
|
+
watermark_mode: Optional[WatermarkMode] = None,
|
|
906
|
+
num_results: Optional[int] = None,
|
|
907
|
+
is_output_temporary: Optional[bool] = None,
|
|
908
|
+
) -> Any:
|
|
909
|
+
return run_tool(
|
|
910
|
+
client,
|
|
911
|
+
controls,
|
|
912
|
+
lambda: client.tools.vectorize_image(**drop_none(
|
|
913
|
+
{
|
|
914
|
+
"image_file_id": image_file_id,
|
|
915
|
+
"watermark_mode": watermark_mode,
|
|
916
|
+
"num_results": num_results,
|
|
917
|
+
"is_output_temporary": is_output_temporary,
|
|
918
|
+
}
|
|
919
|
+
)),
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
register(
|
|
923
|
+
vectorize_image,
|
|
924
|
+
"vectorize_image",
|
|
925
|
+
"Convert any raster image into a scalable vector graphic (SVG). The output traces the shapes and colors of the input image.",
|
|
926
|
+
)
|
|
927
|
+
|
|
928
|
+
def video_to_video(
|
|
929
|
+
prompt: str,
|
|
930
|
+
video_file_id: Optional[str] = None,
|
|
931
|
+
video_url: Optional[str] = None,
|
|
932
|
+
trim_start_seconds: Optional[float] = None,
|
|
933
|
+
trim_end_seconds: Optional[float] = None,
|
|
934
|
+
image_file_ids: Optional[List[str]] = None,
|
|
935
|
+
quality: Optional[ModelQuality] = None,
|
|
936
|
+
audio: Optional[Literal["KEEP_ORIGINAL", "GENERATE"]] = None,
|
|
937
|
+
remix_actions: Optional[List[Dict[str, Any]]] = None,
|
|
938
|
+
is_output_temporary: Optional[bool] = None,
|
|
939
|
+
auto_export: Optional[bool] = None,
|
|
940
|
+
export_options: Optional[Dict[str, Any]] = None,
|
|
941
|
+
) -> Any:
|
|
942
|
+
return run_workflow(
|
|
943
|
+
client,
|
|
944
|
+
controls,
|
|
945
|
+
lambda: client.workflows.video_to_video(**drop_none(
|
|
946
|
+
{
|
|
947
|
+
"prompt": prompt,
|
|
948
|
+
"video_file_id": video_file_id,
|
|
949
|
+
"video_url": video_url,
|
|
950
|
+
"trim_start_seconds": trim_start_seconds,
|
|
951
|
+
"trim_end_seconds": trim_end_seconds,
|
|
952
|
+
"image_file_ids": image_file_ids,
|
|
953
|
+
"quality": quality,
|
|
954
|
+
"audio": audio,
|
|
955
|
+
"remix_actions": remix_actions,
|
|
956
|
+
"is_output_temporary": is_output_temporary,
|
|
957
|
+
"auto_export": auto_export,
|
|
958
|
+
"export_options": export_options,
|
|
959
|
+
}
|
|
960
|
+
)),
|
|
961
|
+
)
|
|
962
|
+
|
|
963
|
+
register(
|
|
964
|
+
video_to_video,
|
|
965
|
+
"video_to_video",
|
|
966
|
+
"Restyle an existing video from a text prompt, keeping its length and timing. Pass exactly one of video_file_id (uploaded video) or video_url (public link). Up to 120 seconds is restyled per run. Provide at least two remix_actions for a polished result.",
|
|
967
|
+
)
|
|
968
|
+
|
|
969
|
+
def voiceover_to_video(
|
|
970
|
+
file_id: str,
|
|
971
|
+
visual_style: Dict[str, Any],
|
|
972
|
+
scenes: Optional[List[Dict[str, Any]]] = None,
|
|
973
|
+
aspect_ratio: Optional[Dict[str, Any]] = None,
|
|
974
|
+
visual_pacing: Optional[VisualPacing] = None,
|
|
975
|
+
quality: Optional[ModelQuality] = None,
|
|
976
|
+
language: Optional[str] = None,
|
|
977
|
+
actor_entity_id: Optional[str] = None,
|
|
978
|
+
avatar_quality: Optional[ModelQuality] = None,
|
|
979
|
+
caption_style: Optional[Dict[str, Any]] = None,
|
|
980
|
+
logo_file_id: Optional[str] = None,
|
|
981
|
+
workflow_agent_context: Optional[str] = None,
|
|
982
|
+
remix_actions: Optional[List[Dict[str, Any]]] = None,
|
|
983
|
+
is_output_temporary: Optional[bool] = None,
|
|
984
|
+
auto_export: Optional[bool] = None,
|
|
985
|
+
export_options: Optional[Dict[str, Any]] = None,
|
|
986
|
+
) -> Any:
|
|
987
|
+
return run_workflow(
|
|
988
|
+
client,
|
|
989
|
+
controls,
|
|
990
|
+
lambda: client.workflows.voiceover_to_video(**drop_none(
|
|
991
|
+
{
|
|
992
|
+
"file_id": file_id,
|
|
993
|
+
"visual_style": visual_style,
|
|
994
|
+
"scenes": scenes,
|
|
995
|
+
"aspect_ratio": aspect_ratio,
|
|
996
|
+
"visual_pacing": visual_pacing,
|
|
997
|
+
"quality": quality,
|
|
998
|
+
"language": language,
|
|
999
|
+
"actor_entity_id": actor_entity_id,
|
|
1000
|
+
"avatar_quality": avatar_quality,
|
|
1001
|
+
"caption_style": caption_style,
|
|
1002
|
+
"logo_file_id": logo_file_id,
|
|
1003
|
+
"workflow_agent_context": workflow_agent_context,
|
|
1004
|
+
"remix_actions": remix_actions,
|
|
1005
|
+
"is_output_temporary": is_output_temporary,
|
|
1006
|
+
"auto_export": auto_export,
|
|
1007
|
+
"export_options": export_options,
|
|
1008
|
+
}
|
|
1009
|
+
)),
|
|
1010
|
+
)
|
|
1011
|
+
|
|
1012
|
+
register(
|
|
1013
|
+
voiceover_to_video,
|
|
1014
|
+
"voiceover_to_video",
|
|
1015
|
+
"Build a narrated video from an uploaded voiceover. Provide at least two remix_actions for a polished result.",
|
|
1016
|
+
)
|
|
1017
|
+
|
|
1018
|
+
return tools
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: crewai-videogen
|
|
3
|
+
Version: 2.5.3
|
|
4
|
+
Summary: Official CrewAI tools for the VideoGen API. Generate videos, images, voiceovers, sound effects, music, and avatars from any CrewAI agent or crew.
|
|
5
|
+
Project-URL: Homepage, https://videogen.io
|
|
6
|
+
Project-URL: Documentation, https://github.com/video-gen/video-workflow-recipes/tree/main/integrations/crewai-videogen#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/video-gen/video-workflow-recipes
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: agents,ai,ai-video-generation,crew,crewai,image-generation,text-to-speech,text-to-video,tools,videogen
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Requires-Dist: crewai>=0.60.0
|
|
12
|
+
Requires-Dist: pydantic>=2.0.0
|
|
13
|
+
Requires-Dist: videogen>=2.5.3
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# crewai-videogen
|
|
19
|
+
|
|
20
|
+
Official [CrewAI](https://www.crewai.com) tools for the [VideoGen API](https://docs.videogen.io). Give any CrewAI agent or crew the ability to turn a script into a finished narrated video, plus generate standalone images, video clips, voiceovers, sound effects, music, and talking-head avatars.
|
|
21
|
+
|
|
22
|
+
Every tool wraps the official [`videogen`](https://pypi.org/project/videogen/) SDK and runs as the team that owns your API key.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install crewai-videogen
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Setup
|
|
31
|
+
|
|
32
|
+
Get an API key from [app.videogen.io/api](https://app.videogen.io/api) and set it as `VIDEOGEN_API_KEY`:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
export VIDEOGEN_API_KEY="your_api_key"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from crewai import Agent, Crew, Task
|
|
42
|
+
from crewai_videogen import create_videogen_tools
|
|
43
|
+
|
|
44
|
+
tools = create_videogen_tools()
|
|
45
|
+
|
|
46
|
+
producer = Agent(
|
|
47
|
+
role="Video Producer",
|
|
48
|
+
goal="Produce short narrated videos on request",
|
|
49
|
+
backstory="An expert at turning briefs into finished videos with VideoGen.",
|
|
50
|
+
tools=tools,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
task = Task(
|
|
54
|
+
description="Make a short narrated video about why hydration matters.",
|
|
55
|
+
expected_output="A link to the finished video.",
|
|
56
|
+
agent=producer,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
crew = Crew(agents=[producer], tasks=[task])
|
|
60
|
+
print(crew.kickoff())
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
By default each tool blocks until the workflow or tool execution finishes and returns the completed result.
|
|
64
|
+
|
|
65
|
+
## Options
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from videogen import VideoGen
|
|
69
|
+
from crewai_videogen import create_videogen_tools
|
|
70
|
+
|
|
71
|
+
tools = create_videogen_tools(
|
|
72
|
+
# Provide a pre-configured client, or pass api_key / base_url, or rely on env.
|
|
73
|
+
client=VideoGen(api_key="your_api_key"),
|
|
74
|
+
|
|
75
|
+
# Return the run/execution id immediately instead of waiting.
|
|
76
|
+
wait=False,
|
|
77
|
+
|
|
78
|
+
# Only expose a subset of tools to the agent.
|
|
79
|
+
include=["script_to_video", "generate_image", "text_to_speech"],
|
|
80
|
+
)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Option | Default | Description |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `client` | — | A pre-configured `VideoGen` client. |
|
|
86
|
+
| `api_key` | `VIDEOGEN_API_KEY` | API key used to build a client when `client` is omitted. |
|
|
87
|
+
| `base_url` | `VIDEOGEN_BASE_URL` or production | Override the API base URL. |
|
|
88
|
+
| `wait` | `True` | Block until the operation finishes and return the result. |
|
|
89
|
+
| `poll_interval_ms` | SDK default | Poll interval while waiting. |
|
|
90
|
+
| `timeout_ms` | SDK default | Maximum time to wait before giving up. |
|
|
91
|
+
| `include` | all tools | Restrict the returned tool set to these tool names. |
|
|
92
|
+
|
|
93
|
+
## Tools
|
|
94
|
+
|
|
95
|
+
<!-- BEGIN GENERATED PYTHON AGENT TOOLS -->
|
|
96
|
+
- Workflows: `cancel_workflow_run`, `get_workflow_run`, `list_workflow_runs`, `prompt_to_video_clip`, `script_to_video`, `slideshow_to_video`, `storyboard_to_video`, `video_to_video`, `voiceover_to_video`.
|
|
97
|
+
- Media generation: `cancel_tool_execution`, `generate_avatar`, `generate_image`, `generate_motion_graphic`, `generate_music`, `generate_sound_effect`, `generate_video_clip`, `get_tool_execution`, `image_3d_effect`, `list_tool_executions`, `remove_image_background`, `remove_video_background`, `text_to_speech`, `upscale_image`, `upscale_video`, `vectorize_image`.
|
|
98
|
+
- Projects: `export_project`, `get_project`, `list_project_remix_actions`, `list_projects`, `remix_project`.
|
|
99
|
+
- Files: `get_file`, `list_files`, `upload_file`.
|
|
100
|
+
- Resources and account: `get_me`, `list_languages`, `list_tts_voices`.
|
|
101
|
+
|
|
102
|
+
Avatar generation and supported video workflows use reusable actor entities. Pass `actor_entity_id` and set `avatar_quality` to `LOW`, `STANDARD`, `HIGH`, or `MAX`. Narrator changes are passed in `remix_actions` as `CHANGE_NARRATOR` action dictionaries.
|
|
103
|
+
<!-- END GENERATED PYTHON AGENT TOOLS -->
|
|
104
|
+
|
|
105
|
+
## Documentation
|
|
106
|
+
|
|
107
|
+
- [Use with AI agents](https://docs.videogen.io/use-with-ai-agents)
|
|
108
|
+
- [MCP server](https://docs.videogen.io/libraries/mcp)
|
|
109
|
+
- [API reference](https://docs.videogen.io)
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
|
114
|
+
|
|
115
|
+
## Account and permissions
|
|
116
|
+
|
|
117
|
+
Generation and editing use your VideoGen account credits. Obtain user approval before invoking credit-consuming tools. Restrict the `include` list when an agent only needs read access. Keep API keys in server-side environment variables and out of shared transcripts.
|
|
118
|
+
|
|
119
|
+
[VideoGen](https://videogen.io/) · [MCP setup](https://videogen.io/videogen-mcp) · [Source](https://github.com/video-gen/video-workflow-recipes/tree/main/integrations/crewai-videogen)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
crewai_videogen/__init__.py,sha256=AbLWNp6k1x8ddAljGEZT5ydsb5k2Vx-hOVA1069nxWc,412
|
|
2
|
+
crewai_videogen/client.py,sha256=kY3wq0OPTfE3skE9qwBOC7vZMymm0Jbftg2Twf01F-Q,1519
|
|
3
|
+
crewai_videogen/operations.py,sha256=U3UsYtcQ09dSH7akHalXYK3Kuo9OErI4sbiRCR2qkxM,2708
|
|
4
|
+
crewai_videogen/toolkit.py,sha256=A5_tC0RQ8FRbdKC7mYaqb1IRaG5wpkpKKUBWtdv_36k,1781
|
|
5
|
+
crewai_videogen/tools.py,sha256=2Clzw6GT9fbOBztfqHWf6rK6QI7yAtXKo92uzSeuHpQ,43165
|
|
6
|
+
crewai_videogen-2.5.3.dist-info/METADATA,sha256=f06xvOeniJzdRVyRPlxnoHrjMt0WaBJ_w6edg_Xvtnk,5057
|
|
7
|
+
crewai_videogen-2.5.3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
8
|
+
crewai_videogen-2.5.3.dist-info/RECORD,,
|