Overview
Tool identifiervideo_generate.
video_generate generates videos from text. The example below first uses image_generate to create a first and last frame, then composes a video.
Import path: from veadk.tools.builtin_tools.video_generate import video_generate
Environment & prerequisites
Environment variables:MODEL_VIDEO_API_KEY: API key for the video-generation model; falls back toMODEL_AGENT_API_KEYand then tomodel.api_keyfrom the config file when unsetMODEL_AGENT_API_KEY: API key for the agent’s reasoning modelMODEL_VIDEO_NAME: video-generation model nameMODEL_VIDEO_API_BASE: video-generation model API endpoint; defaults to the ModelArk endpointMODEL_IMAGE_NAME: image-generation model name
Credentials are resolved at tool execution time, not at import time. Importing the tool module does not initialize a client or require credentials to be present.
config.yaml keys:
config.yaml
CLOUD_PROVIDER overrides media configuration. Capabilities and parameter limits depend on the selected model service. The video API base and default model name are resolved at import time; configure them before starting the process.
Usage
examples/tools/video_generate/agent.py
Parameters and task states
Each request requires
video_name: str and prompt: str. Other fields use service defaults when omitted:
Results contain
status, success_list, error_list, error_details, and pending_list. Success items map video names to URLs. Pending items include a task_id. Ending local waiting does not cancel remote generation; query the existing task instead of resubmitting it.
video_task_query(task_id: str, tool_context: ToolContext) requires the task ID and injected context, with no optional arguments. It returns fields including status, video_url, and error. queued and running are still in progress; deliver a video only after succeeded with a URL. Inspect errors for failed tasks. Query using the same service endpoint and authorized credentials as generation.