multi-modal-mcp 0.0.5 → 0.0.6
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.
|
@@ -35,10 +35,10 @@ class VideoGenerationTool extends MCPTool {
|
|
|
35
35
|
.optional()
|
|
36
36
|
.default(false)
|
|
37
37
|
.describe('控制是否添加水印,默认false'),
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
imageUrl: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('用于内容生成的基础图像,支持 URL 或 Base64 编码图像').default(''),
|
|
42
42
|
size: z
|
|
43
43
|
.enum([
|
|
44
44
|
'720x480',
|
|
@@ -70,10 +70,12 @@ class VideoGenerationTool extends MCPTool {
|
|
|
70
70
|
quality: input.quality,
|
|
71
71
|
with_audio: input.withAudio,
|
|
72
72
|
watermark_enabled: input.watermarkEnabled,
|
|
73
|
-
// image_url: input.imageUrl,
|
|
74
73
|
size: input.size,
|
|
75
74
|
fps: parseInt(String(input.fps)),
|
|
75
|
+
image_url: undefined
|
|
76
76
|
};
|
|
77
|
+
if (input.imageUrl)
|
|
78
|
+
requestData.image_url = input.imageUrl;
|
|
77
79
|
const apiResponse = (await http.post('/videos/generations', requestData));
|
|
78
80
|
const taskId = apiResponse.id;
|
|
79
81
|
if (!taskId)
|
|
@@ -89,7 +91,7 @@ class VideoGenerationTool extends MCPTool {
|
|
|
89
91
|
*/
|
|
90
92
|
async pollTaskStatus(taskId) {
|
|
91
93
|
const startTime = Date.now();
|
|
92
|
-
const timeout = 60000 *
|
|
94
|
+
const timeout = 60000 * 5; // 5分钟
|
|
93
95
|
while (true) {
|
|
94
96
|
const elapsedTime = Date.now() - startTime;
|
|
95
97
|
if (elapsedTime >= timeout)
|