multi-modal-mcp 0.0.3 → 0.0.4
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.
- package/dist/config.js +1 -1
- package/dist/tools/VideoGenerationTool.js +8 -10
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -67,19 +67,18 @@ class VideoGenerationTool extends MCPTool {
|
|
|
67
67
|
const requestData = {
|
|
68
68
|
model: config.videoModel,
|
|
69
69
|
prompt: input.prompt,
|
|
70
|
-
quality: input.quality
|
|
71
|
-
with_audio: input.withAudio
|
|
72
|
-
watermark_enabled: input.watermarkEnabled
|
|
70
|
+
quality: input.quality,
|
|
71
|
+
with_audio: input.withAudio,
|
|
72
|
+
watermark_enabled: input.watermarkEnabled,
|
|
73
73
|
image_url: input.imageUrl,
|
|
74
74
|
size: input.size,
|
|
75
|
-
fps: input.fps
|
|
75
|
+
fps: input.fps,
|
|
76
76
|
};
|
|
77
77
|
const apiResponse = (await http.post('/videos/generations', requestData));
|
|
78
78
|
const taskId = apiResponse.id;
|
|
79
79
|
if (!taskId)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return videoUrl;
|
|
80
|
+
return `视频生成失败,${JSON.stringify(apiResponse)}`;
|
|
81
|
+
return await this.pollTaskStatus(taskId);
|
|
83
82
|
}
|
|
84
83
|
catch (error) {
|
|
85
84
|
return `视频生成时发生错误: ${error}`;
|
|
@@ -93,9 +92,8 @@ class VideoGenerationTool extends MCPTool {
|
|
|
93
92
|
const timeout = 60000;
|
|
94
93
|
while (true) {
|
|
95
94
|
const elapsedTime = Date.now() - startTime;
|
|
96
|
-
if (elapsedTime >= timeout)
|
|
97
|
-
|
|
98
|
-
}
|
|
95
|
+
if (elapsedTime >= timeout)
|
|
96
|
+
return `任务超时,请检查任务状态`;
|
|
99
97
|
const apiResponse = (await http.get(`/async-result/${taskId}`));
|
|
100
98
|
const taskData = apiResponse;
|
|
101
99
|
if (taskData.task_status === 'SUCCESS' &&
|