mulmocast 2.1.23 → 2.1.24
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/lib/agents/image_genai_agent.js +14 -6
- package/lib/agents/movie_genai_agent.js +35 -19
- package/lib/methods/mulmo_presentation_style.d.ts +2 -0
- package/lib/types/agent.d.ts +4 -0
- package/lib/types/provider2agent.d.ts +1 -1
- package/lib/types/provider2agent.js +8 -2
- package/lib/types/schema.d.ts +38 -0
- package/lib/types/schema.js +4 -0
- package/lib/utils/context.d.ts +20 -0
- package/package.json +1 -1
- package/scripts/test/test_vertexai.json +21 -0
|
@@ -59,12 +59,20 @@ export const imageGenAIAgent = async ({ namedInputs, params, config, }) => {
|
|
|
59
59
|
const { prompt, referenceImages } = namedInputs;
|
|
60
60
|
const model = params.model ?? provider2ImageAgent["google"].defaultModel;
|
|
61
61
|
const apiKey = config?.apiKey;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
const ai = params.vertexai_project
|
|
63
|
+
? new GoogleGenAI({
|
|
64
|
+
vertexai: true,
|
|
65
|
+
project: params.vertexai_project,
|
|
66
|
+
location: params.vertexai_location ?? "us-central1",
|
|
67
|
+
})
|
|
68
|
+
: (() => {
|
|
69
|
+
if (!apiKey) {
|
|
70
|
+
throw new Error("Google GenAI API key is required (GEMINI_API_KEY)", {
|
|
71
|
+
cause: apiKeyMissingError("imageGenAIAgent", imageAction, "GEMINI_API_KEY"),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return new GoogleGenAI({ apiKey });
|
|
75
|
+
})();
|
|
68
76
|
if (model === "gemini-2.5-flash-image" || model === "gemini-3-pro-image-preview") {
|
|
69
77
|
const contentParams = (() => {
|
|
70
78
|
const contents = getGeminiContents(prompt, referenceImages);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync } from "fs";
|
|
1
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
2
2
|
import { GraphAILogger, sleep } from "graphai";
|
|
3
3
|
import { GoogleGenAI, PersonGeneration } from "@google/genai";
|
|
4
4
|
import { apiKeyMissingError, agentGenerationError, agentInvalidResponseError, imageAction, movieFileTarget, videoDurationTarget, hasCause, } from "../utils/error_cause.js";
|
|
@@ -35,12 +35,19 @@ const loadImageAsBase64 = (imagePath) => {
|
|
|
35
35
|
mimeType: "image/png",
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
|
-
const downloadVideo = async (ai, video, movieFile) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
38
|
+
const downloadVideo = async (ai, video, movieFile, isVertexAI) => {
|
|
39
|
+
if (isVertexAI) {
|
|
40
|
+
// Vertex AI returns videoBytes directly
|
|
41
|
+
writeFileSync(movieFile, Buffer.from(video.videoBytes, "base64"));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Gemini API requires download via uri
|
|
45
|
+
await ai.files.download({
|
|
46
|
+
file: video,
|
|
47
|
+
downloadPath: movieFile,
|
|
48
|
+
});
|
|
49
|
+
await sleep(5000); // HACK: Without this, the file is not ready yet.
|
|
50
|
+
}
|
|
44
51
|
return { saved: movieFile };
|
|
45
52
|
};
|
|
46
53
|
const createVeo31Payload = (model, prompt, aspectRatio, source) => ({
|
|
@@ -53,7 +60,7 @@ const createVeo31Payload = (model, prompt, aspectRatio, source) => ({
|
|
|
53
60
|
},
|
|
54
61
|
...source,
|
|
55
62
|
});
|
|
56
|
-
const generateExtendedVideo = async (ai, model, prompt, aspectRatio, imagePath, requestedDuration, movieFile) => {
|
|
63
|
+
const generateExtendedVideo = async (ai, model, prompt, aspectRatio, imagePath, requestedDuration, movieFile, isVertexAI) => {
|
|
57
64
|
const initialDuration = 8;
|
|
58
65
|
const maxExtensionDuration = 8;
|
|
59
66
|
const extensionsNeeded = Math.ceil((requestedDuration - initialDuration) / maxExtensionDuration);
|
|
@@ -85,9 +92,9 @@ const generateExtendedVideo = async (ai, model, prompt, aspectRatio, imagePath,
|
|
|
85
92
|
cause: agentInvalidResponseError("movieGenAIAgent", imageAction, movieFileTarget),
|
|
86
93
|
});
|
|
87
94
|
}
|
|
88
|
-
return downloadVideo(ai, result.video, movieFile);
|
|
95
|
+
return downloadVideo(ai, result.video, movieFile, isVertexAI);
|
|
89
96
|
};
|
|
90
|
-
const generateStandardVideo = async (ai, model, prompt, aspectRatio, imagePath, duration, movieFile) => {
|
|
97
|
+
const generateStandardVideo = async (ai, model, prompt, aspectRatio, imagePath, duration, movieFile, isVertexAI) => {
|
|
91
98
|
const isVeo3 = model === "veo-3.0-generate-001" || model === "veo-3.1-generate-preview";
|
|
92
99
|
const payload = {
|
|
93
100
|
model,
|
|
@@ -102,18 +109,13 @@ const generateStandardVideo = async (ai, model, prompt, aspectRatio, imagePath,
|
|
|
102
109
|
const operation = await ai.models.generateVideos(payload);
|
|
103
110
|
const response = await pollUntilDone(ai, operation);
|
|
104
111
|
const video = getVideoFromResponse(response);
|
|
105
|
-
return downloadVideo(ai, video, movieFile);
|
|
112
|
+
return downloadVideo(ai, video, movieFile, isVertexAI);
|
|
106
113
|
};
|
|
107
114
|
export const movieGenAIAgent = async ({ namedInputs, params, config, }) => {
|
|
108
115
|
const { prompt, imagePath, movieFile } = namedInputs;
|
|
109
116
|
const aspectRatio = getAspectRatio(params.canvasSize, ASPECT_RATIOS);
|
|
110
117
|
const model = params.model ?? provider2MovieAgent.google.defaultModel;
|
|
111
118
|
const apiKey = config?.apiKey;
|
|
112
|
-
if (!apiKey) {
|
|
113
|
-
throw new Error("Google GenAI API key is required (GEMINI_API_KEY)", {
|
|
114
|
-
cause: apiKeyMissingError("movieGenAIAgent", imageAction, "GEMINI_API_KEY"),
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
119
|
try {
|
|
118
120
|
const requestedDuration = params.duration ?? 8;
|
|
119
121
|
const duration = getModelDuration("google", model, requestedDuration);
|
|
@@ -122,13 +124,27 @@ export const movieGenAIAgent = async ({ namedInputs, params, config, }) => {
|
|
|
122
124
|
cause: agentGenerationError("movieGenAIAgent", imageAction, videoDurationTarget),
|
|
123
125
|
});
|
|
124
126
|
}
|
|
125
|
-
const
|
|
127
|
+
const isVertexAI = !!params.vertexai_project;
|
|
128
|
+
const ai = isVertexAI
|
|
129
|
+
? new GoogleGenAI({
|
|
130
|
+
vertexai: true,
|
|
131
|
+
project: params.vertexai_project,
|
|
132
|
+
location: params.vertexai_location ?? "us-central1",
|
|
133
|
+
})
|
|
134
|
+
: (() => {
|
|
135
|
+
if (!apiKey) {
|
|
136
|
+
throw new Error("Google GenAI API key is required (GEMINI_API_KEY)", {
|
|
137
|
+
cause: apiKeyMissingError("movieGenAIAgent", imageAction, "GEMINI_API_KEY"),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return new GoogleGenAI({ apiKey });
|
|
141
|
+
})();
|
|
126
142
|
// Veo 3.1: Video extension mode for videos longer than 8s
|
|
127
143
|
if (model === "veo-3.1-generate-preview" && requestedDuration > 8 && params.canvasSize) {
|
|
128
|
-
return generateExtendedVideo(ai, model, prompt, aspectRatio, imagePath, requestedDuration, movieFile);
|
|
144
|
+
return generateExtendedVideo(ai, model, prompt, aspectRatio, imagePath, requestedDuration, movieFile, isVertexAI);
|
|
129
145
|
}
|
|
130
146
|
// Standard mode
|
|
131
|
-
return generateStandardVideo(ai, model, prompt, aspectRatio, imagePath, duration, movieFile);
|
|
147
|
+
return generateStandardVideo(ai, model, prompt, aspectRatio, imagePath, duration, movieFile, isVertexAI);
|
|
132
148
|
}
|
|
133
149
|
catch (error) {
|
|
134
150
|
GraphAILogger.info("Failed to generate movie:", error.message);
|
|
@@ -171,6 +171,8 @@ export declare const MulmoPresentationStyleMethods: {
|
|
|
171
171
|
type: "custom";
|
|
172
172
|
filter: string;
|
|
173
173
|
})[] | undefined;
|
|
174
|
+
vertexai_project?: string | undefined;
|
|
175
|
+
vertexai_location?: string | undefined;
|
|
174
176
|
speed?: number | undefined;
|
|
175
177
|
};
|
|
176
178
|
keyName: string;
|
package/lib/types/agent.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export type ImageAgentParams = {
|
|
|
39
39
|
width: number;
|
|
40
40
|
height: number;
|
|
41
41
|
};
|
|
42
|
+
vertexai_project?: string;
|
|
43
|
+
vertexai_location?: string;
|
|
42
44
|
};
|
|
43
45
|
export type OpenAIImageAgentParams = ImageAgentParams & {
|
|
44
46
|
moderation: OpenAIImageModeration | null | undefined;
|
|
@@ -74,6 +76,8 @@ export type MovieAgentInputs = AgentPromptInputs & {
|
|
|
74
76
|
};
|
|
75
77
|
export type GoogleMovieAgentParams = ImageAgentParams & {
|
|
76
78
|
duration?: number;
|
|
79
|
+
vertexai_project?: string;
|
|
80
|
+
vertexai_location?: string;
|
|
77
81
|
};
|
|
78
82
|
export type ReplicateMovieAgentParams = {
|
|
79
83
|
model: `${string}/${string}` | undefined;
|
|
@@ -155,7 +155,7 @@ export declare const provider2LLMAgent: {
|
|
|
155
155
|
readonly agentName: "geminiAgent";
|
|
156
156
|
readonly defaultModel: "gemini-2.5-flash";
|
|
157
157
|
readonly max_tokens: 8192;
|
|
158
|
-
readonly models: readonly ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
158
|
+
readonly models: readonly ["gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
159
159
|
readonly keyName: "GEMINI_API_KEY";
|
|
160
160
|
};
|
|
161
161
|
readonly groq: {
|
|
@@ -56,7 +56,13 @@ export const provider2ImageAgent = {
|
|
|
56
56
|
google: {
|
|
57
57
|
agentName: "imageGenAIAgent",
|
|
58
58
|
defaultModel: "gemini-2.5-flash-image",
|
|
59
|
-
models: [
|
|
59
|
+
models: [
|
|
60
|
+
"imagen-4.0-generate-001",
|
|
61
|
+
"imagen-4.0-ultra-generate-001",
|
|
62
|
+
"imagen-4.0-fast-generate-001",
|
|
63
|
+
"gemini-2.5-flash-image",
|
|
64
|
+
"gemini-3-pro-image-preview",
|
|
65
|
+
],
|
|
60
66
|
keyName: "GEMINI_API_KEY",
|
|
61
67
|
},
|
|
62
68
|
replicate: {
|
|
@@ -283,7 +289,7 @@ export const provider2LLMAgent = {
|
|
|
283
289
|
agentName: "geminiAgent",
|
|
284
290
|
defaultModel: "gemini-2.5-flash",
|
|
285
291
|
max_tokens: 8192,
|
|
286
|
-
models: ["gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"],
|
|
292
|
+
models: ["gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"],
|
|
287
293
|
keyName: "GEMINI_API_KEY",
|
|
288
294
|
},
|
|
289
295
|
groq: {
|
package/lib/types/schema.d.ts
CHANGED
|
@@ -453,6 +453,8 @@ export declare const mulmoBeatImageParamsSchema: z.ZodObject<{
|
|
|
453
453
|
moderation: z.ZodOptional<z.ZodString>;
|
|
454
454
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
455
455
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
456
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
457
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
456
458
|
}, z.core.$strict>;
|
|
457
459
|
export declare const mulmoImageParamsSchema: z.ZodObject<{
|
|
458
460
|
provider: z.ZodOptional<z.ZodEnum<{
|
|
@@ -464,6 +466,8 @@ export declare const mulmoImageParamsSchema: z.ZodObject<{
|
|
|
464
466
|
moderation: z.ZodOptional<z.ZodString>;
|
|
465
467
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
466
468
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
469
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
470
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
467
471
|
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
468
472
|
type: z.ZodLiteral<"image">;
|
|
469
473
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -781,6 +785,8 @@ export declare const mulmoMovieParamsSchema: z.ZodObject<{
|
|
|
781
785
|
type: z.ZodLiteral<"custom">;
|
|
782
786
|
filter: z.ZodString;
|
|
783
787
|
}, z.core.$strip>]>>>;
|
|
788
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
789
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
784
790
|
}, z.core.$strip>;
|
|
785
791
|
export declare const mulmoBeatSchema: z.ZodObject<{
|
|
786
792
|
speaker: z.ZodOptional<z.ZodString>;
|
|
@@ -911,6 +917,8 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
911
917
|
moderation: z.ZodOptional<z.ZodString>;
|
|
912
918
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
913
919
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
920
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
921
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
914
922
|
}, z.core.$strict>>;
|
|
915
923
|
audioParams: z.ZodOptional<z.ZodObject<{
|
|
916
924
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1143,6 +1151,8 @@ export declare const mulmoBeatSchema: z.ZodObject<{
|
|
|
1143
1151
|
type: z.ZodLiteral<"custom">;
|
|
1144
1152
|
filter: z.ZodString;
|
|
1145
1153
|
}, z.core.$strip>]>>>;
|
|
1154
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
1155
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
1146
1156
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
1147
1157
|
}, z.core.$strip>>;
|
|
1148
1158
|
soundEffectParams: z.ZodOptional<z.ZodObject<{
|
|
@@ -1275,6 +1285,8 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
1275
1285
|
moderation: z.ZodOptional<z.ZodString>;
|
|
1276
1286
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
1277
1287
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
1288
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
1289
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
1278
1290
|
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
1279
1291
|
type: z.ZodLiteral<"image">;
|
|
1280
1292
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1519,6 +1531,8 @@ export declare const mulmoPresentationStyleSchema: z.ZodObject<{
|
|
|
1519
1531
|
type: z.ZodLiteral<"custom">;
|
|
1520
1532
|
filter: z.ZodString;
|
|
1521
1533
|
}, z.core.$strip>]>>>;
|
|
1534
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
1535
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
1522
1536
|
}, z.core.$strip>>>;
|
|
1523
1537
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1524
1538
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -1642,6 +1656,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
1642
1656
|
moderation: z.ZodOptional<z.ZodString>;
|
|
1643
1657
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
1644
1658
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
1659
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
1660
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
1645
1661
|
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
1646
1662
|
type: z.ZodLiteral<"image">;
|
|
1647
1663
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -1886,6 +1902,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
1886
1902
|
type: z.ZodLiteral<"custom">;
|
|
1887
1903
|
filter: z.ZodString;
|
|
1888
1904
|
}, z.core.$strip>]>>>;
|
|
1905
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
1906
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
1889
1907
|
}, z.core.$strip>>>;
|
|
1890
1908
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
1891
1909
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -2083,6 +2101,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
2083
2101
|
moderation: z.ZodOptional<z.ZodString>;
|
|
2084
2102
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
2085
2103
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
2104
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
2105
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
2086
2106
|
}, z.core.$strict>>;
|
|
2087
2107
|
audioParams: z.ZodOptional<z.ZodObject<{
|
|
2088
2108
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2315,6 +2335,8 @@ export declare const mulmoScriptSchema: z.ZodObject<{
|
|
|
2315
2335
|
type: z.ZodLiteral<"custom">;
|
|
2316
2336
|
filter: z.ZodString;
|
|
2317
2337
|
}, z.core.$strip>]>>>;
|
|
2338
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
2339
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
2318
2340
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
2319
2341
|
}, z.core.$strip>>;
|
|
2320
2342
|
soundEffectParams: z.ZodOptional<z.ZodObject<{
|
|
@@ -2522,6 +2544,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
2522
2544
|
moderation: z.ZodOptional<z.ZodString>;
|
|
2523
2545
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
2524
2546
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
2547
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
2548
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
2525
2549
|
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
2526
2550
|
type: z.ZodLiteral<"image">;
|
|
2527
2551
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -2766,6 +2790,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
2766
2790
|
type: z.ZodLiteral<"custom">;
|
|
2767
2791
|
filter: z.ZodString;
|
|
2768
2792
|
}, z.core.$strip>]>>>;
|
|
2793
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
2794
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
2769
2795
|
}, z.core.$strip>>>;
|
|
2770
2796
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
2771
2797
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -2963,6 +2989,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
2963
2989
|
moderation: z.ZodOptional<z.ZodString>;
|
|
2964
2990
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
2965
2991
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
2992
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
2993
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
2966
2994
|
}, z.core.$strict>>;
|
|
2967
2995
|
audioParams: z.ZodOptional<z.ZodObject<{
|
|
2968
2996
|
padding: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3195,6 +3223,8 @@ export declare const mulmoStudioSchema: z.ZodObject<{
|
|
|
3195
3223
|
type: z.ZodLiteral<"custom">;
|
|
3196
3224
|
filter: z.ZodString;
|
|
3197
3225
|
}, z.core.$strip>]>>>;
|
|
3226
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
3227
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
3198
3228
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
3199
3229
|
}, z.core.$strip>>;
|
|
3200
3230
|
soundEffectParams: z.ZodOptional<z.ZodObject<{
|
|
@@ -3338,6 +3368,8 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
3338
3368
|
moderation: z.ZodOptional<z.ZodString>;
|
|
3339
3369
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
3340
3370
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
3371
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
3372
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
3341
3373
|
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
3342
3374
|
type: z.ZodLiteral<"image">;
|
|
3343
3375
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -3582,6 +3614,8 @@ export declare const mulmoPromptTemplateSchema: z.ZodObject<{
|
|
|
3582
3614
|
type: z.ZodLiteral<"custom">;
|
|
3583
3615
|
filter: z.ZodString;
|
|
3584
3616
|
}, z.core.$strip>]>>>;
|
|
3617
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
3618
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
3585
3619
|
}, z.core.$strip>>>;
|
|
3586
3620
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
3587
3621
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
@@ -3699,6 +3733,8 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
3699
3733
|
moderation: z.ZodOptional<z.ZodString>;
|
|
3700
3734
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
3701
3735
|
apiVersion: z.ZodOptional<z.ZodString>;
|
|
3736
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
3737
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
3702
3738
|
images: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
3703
3739
|
type: z.ZodLiteral<"image">;
|
|
3704
3740
|
source: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -3943,6 +3979,8 @@ export declare const mulmoPromptTemplateFileSchema: z.ZodObject<{
|
|
|
3943
3979
|
type: z.ZodLiteral<"custom">;
|
|
3944
3980
|
filter: z.ZodString;
|
|
3945
3981
|
}, z.core.$strip>]>>>;
|
|
3982
|
+
vertexai_project: z.ZodOptional<z.ZodString>;
|
|
3983
|
+
vertexai_location: z.ZodOptional<z.ZodString>;
|
|
3946
3984
|
}, z.core.$strip>>>;
|
|
3947
3985
|
soundEffectParams: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
3948
3986
|
provider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
package/lib/types/schema.js
CHANGED
|
@@ -244,6 +244,8 @@ export const mulmoBeatImageParamsSchema = z
|
|
|
244
244
|
moderation: z.string().optional(), // optional image style
|
|
245
245
|
baseURL: z.string().optional(), // Azure/custom endpoint URL
|
|
246
246
|
apiVersion: z.string().optional(), // Azure API version (e.g., "2025-04-01-preview")
|
|
247
|
+
vertexai_project: z.string().optional(), // Google Cloud Project ID for Vertex AI
|
|
248
|
+
vertexai_location: z.string().optional(), // Vertex AI location (default: us-central1)
|
|
247
249
|
})
|
|
248
250
|
.strict();
|
|
249
251
|
export const mulmoImageParamsSchema = mulmoBeatImageParamsSchema
|
|
@@ -326,6 +328,8 @@ export const mulmoMovieParamsSchema = z.object({
|
|
|
326
328
|
fillOption: mulmoFillOptionSchema.optional(), // for movie.ts
|
|
327
329
|
transition: mulmoTransitionSchema.optional(), // for movie.ts
|
|
328
330
|
filters: z.array(mulmoVideoFilterSchema).optional(), // for movie.ts
|
|
331
|
+
vertexai_project: z.string().optional(), // Google Cloud Project ID for Vertex AI
|
|
332
|
+
vertexai_location: z.string().optional(), // Vertex AI location (default: us-central1)
|
|
329
333
|
});
|
|
330
334
|
export const mulmoBeatSchema = z
|
|
331
335
|
.object({
|
package/lib/utils/context.d.ts
CHANGED
|
@@ -52,6 +52,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
52
52
|
moderation?: string | undefined;
|
|
53
53
|
baseURL?: string | undefined;
|
|
54
54
|
apiVersion?: string | undefined;
|
|
55
|
+
vertexai_project?: string | undefined;
|
|
56
|
+
vertexai_location?: string | undefined;
|
|
55
57
|
images?: Record<string, {
|
|
56
58
|
type: "image";
|
|
57
59
|
source: {
|
|
@@ -225,6 +227,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
225
227
|
type: "custom";
|
|
226
228
|
filter: string;
|
|
227
229
|
})[] | undefined;
|
|
230
|
+
vertexai_project?: string | undefined;
|
|
231
|
+
vertexai_location?: string | undefined;
|
|
228
232
|
};
|
|
229
233
|
soundEffectParams: {
|
|
230
234
|
provider?: string | undefined;
|
|
@@ -377,6 +381,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
377
381
|
moderation?: string | undefined;
|
|
378
382
|
baseURL?: string | undefined;
|
|
379
383
|
apiVersion?: string | undefined;
|
|
384
|
+
vertexai_project?: string | undefined;
|
|
385
|
+
vertexai_location?: string | undefined;
|
|
380
386
|
} | undefined;
|
|
381
387
|
audioParams?: {
|
|
382
388
|
movieVolume: number;
|
|
@@ -538,6 +544,8 @@ export declare const createStudioData: (_mulmoScript: MulmoScript, fileName: str
|
|
|
538
544
|
type: "custom";
|
|
539
545
|
filter: string;
|
|
540
546
|
})[] | undefined;
|
|
547
|
+
vertexai_project?: string | undefined;
|
|
548
|
+
vertexai_location?: string | undefined;
|
|
541
549
|
speed?: number | undefined;
|
|
542
550
|
} | undefined;
|
|
543
551
|
soundEffectParams?: {
|
|
@@ -700,6 +708,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
700
708
|
moderation?: string | undefined;
|
|
701
709
|
baseURL?: string | undefined;
|
|
702
710
|
apiVersion?: string | undefined;
|
|
711
|
+
vertexai_project?: string | undefined;
|
|
712
|
+
vertexai_location?: string | undefined;
|
|
703
713
|
images?: Record<string, {
|
|
704
714
|
type: "image";
|
|
705
715
|
source: {
|
|
@@ -873,6 +883,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
873
883
|
type: "custom";
|
|
874
884
|
filter: string;
|
|
875
885
|
})[] | undefined;
|
|
886
|
+
vertexai_project?: string | undefined;
|
|
887
|
+
vertexai_location?: string | undefined;
|
|
876
888
|
};
|
|
877
889
|
soundEffectParams: {
|
|
878
890
|
provider?: string | undefined;
|
|
@@ -1025,6 +1037,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
1025
1037
|
moderation?: string | undefined;
|
|
1026
1038
|
baseURL?: string | undefined;
|
|
1027
1039
|
apiVersion?: string | undefined;
|
|
1040
|
+
vertexai_project?: string | undefined;
|
|
1041
|
+
vertexai_location?: string | undefined;
|
|
1028
1042
|
} | undefined;
|
|
1029
1043
|
audioParams?: {
|
|
1030
1044
|
movieVolume: number;
|
|
@@ -1186,6 +1200,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
1186
1200
|
type: "custom";
|
|
1187
1201
|
filter: string;
|
|
1188
1202
|
})[] | undefined;
|
|
1203
|
+
vertexai_project?: string | undefined;
|
|
1204
|
+
vertexai_location?: string | undefined;
|
|
1189
1205
|
speed?: number | undefined;
|
|
1190
1206
|
} | undefined;
|
|
1191
1207
|
soundEffectParams?: {
|
|
@@ -1355,6 +1371,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
1355
1371
|
moderation?: string | undefined;
|
|
1356
1372
|
baseURL?: string | undefined;
|
|
1357
1373
|
apiVersion?: string | undefined;
|
|
1374
|
+
vertexai_project?: string | undefined;
|
|
1375
|
+
vertexai_location?: string | undefined;
|
|
1358
1376
|
images?: Record<string, {
|
|
1359
1377
|
type: "image";
|
|
1360
1378
|
source: {
|
|
@@ -1528,6 +1546,8 @@ export declare const initializeContextFromFiles: (files: FileObject, raiseError:
|
|
|
1528
1546
|
type: "custom";
|
|
1529
1547
|
filter: string;
|
|
1530
1548
|
})[] | undefined;
|
|
1549
|
+
vertexai_project?: string | undefined;
|
|
1550
|
+
vertexai_location?: string | undefined;
|
|
1531
1551
|
};
|
|
1532
1552
|
soundEffectParams: {
|
|
1533
1553
|
provider?: string | undefined;
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../assets/schema.json",
|
|
3
|
+
"title": "Vertex AI Test",
|
|
4
|
+
"description": "Test Vertex AI integration",
|
|
5
|
+
"lang": "en",
|
|
6
|
+
"imageParams": {
|
|
7
|
+
"provider": "google",
|
|
8
|
+
"model": "imagen-4.0-generate-001",
|
|
9
|
+
"vertexai_project": "${GOOGLE_PROJECT_ID}",
|
|
10
|
+
"vertexai_location": "us-central1"
|
|
11
|
+
},
|
|
12
|
+
"speechParams": {
|
|
13
|
+
"provider": "mock"
|
|
14
|
+
},
|
|
15
|
+
"beats": [
|
|
16
|
+
{
|
|
17
|
+
"text": "Hello",
|
|
18
|
+
"imagePrompt": "A simple blue circle on white background"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|