Create a video generation task based on provided text content and images. The task is submitted immediately; the system will automatically poll the task status and retrieve the video link.
✅ Recommended for these situations:
❌ Do not use for the following cases:
export MAGIC_API_KEY="your-key"
MAGIC_API_KEY is the required environment variable for the remote video service client.
TEXT) and image address or path (IMAGE) from the user's message.video-create subcommand to create the task, read the stdout JSON output, and extract the task_id.task_id in the chat by outputting "Video generation task has been created, task ID: task_id. I will keep checking the task status and inform you when the video link is ready."video-wait subcommand with --task-id to poll the task until completion. Task status equal to 2 means success.video_url from the video-wait command's stdout.video_url in the chat. If timeout occurs, report it as well.task_id in ChatTEXT; get the image address and store it in IMAGE.", be sure to escape them (e.g., replace " with \") to prevent command parsing errors.{baseDir} will be replaced with the skill directory):python3 {baseDir}/scripts/media_gen_client.py video-create \
--text "TEXT" --image "IMAGE"
{
"biz_code": 10000,
"msg": "Success",
"data": {
"task_id": "2032443088023777280"
},
"trace_id": "664c6e22-1edd-11f1-bf4c-8262dce7d13f"
}
task_id from the JSON (e.g. "abc-123"), and inform the user in the chat:task_id. I will keep checking the task status and inform you when the video link is ready."video_url in Chattask_id obtained in the previous step.python3 {baseDir}/scripts/media_gen_client.py video-wait --task-id YOUR_TASK_ID --poll 10 --timeout 600
{
"biz_code": 10000,
"msg": "Success",
"data": {
"task_id": "1234567890",
"task_status": 2,
"video_url": "https://www.magiclight.com/examplevideo.mp4"
},
"trace_id": "c89aeca8-1edd-11f1-bf4c-8262dce7d13f"
}
task_status: 2), where status 2 means successvideo_url: "https://example.com/path/to/video.mp4")> "Task complete ✅
> task_id: abc-123
> Video link: https://example.com/path/to/video.mp4"
success is false, video_url is empty, or error is timeout):共 2 个版本