mulmocast 0.1.2 → 0.1.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.
Files changed (60) hide show
  1. package/assets/templates/characters.json +16 -0
  2. package/assets/templates/html.json +6 -0
  3. package/lib/actions/audio.js +13 -19
  4. package/lib/actions/image_agents.d.ts +145 -0
  5. package/lib/actions/image_agents.js +59 -0
  6. package/lib/actions/image_references.d.ts +9 -0
  7. package/lib/actions/image_references.js +79 -0
  8. package/lib/actions/images.d.ts +17 -109
  9. package/lib/actions/images.js +83 -188
  10. package/lib/actions/index.d.ts +2 -0
  11. package/lib/actions/index.js +2 -0
  12. package/lib/actions/movie.js +3 -1
  13. package/lib/actions/pdf.js +5 -2
  14. package/lib/agents/image_google_agent.d.ts +2 -15
  15. package/lib/agents/image_google_agent.js +5 -5
  16. package/lib/agents/image_openai_agent.d.ts +2 -17
  17. package/lib/agents/image_openai_agent.js +9 -9
  18. package/lib/agents/movie_google_agent.d.ts +2 -17
  19. package/lib/agents/movie_google_agent.js +7 -7
  20. package/lib/agents/movie_replicate_agent.d.ts +2 -16
  21. package/lib/agents/movie_replicate_agent.js +4 -4
  22. package/lib/agents/tts_google_agent.d.ts +9 -1
  23. package/lib/agents/tts_google_agent.js +2 -2
  24. package/lib/agents/tts_nijivoice_agent.js +1 -1
  25. package/lib/agents/tts_openai_agent.d.ts +13 -1
  26. package/lib/agents/tts_openai_agent.js +2 -2
  27. package/lib/cli/helpers.js +7 -7
  28. package/lib/index.d.ts +1 -0
  29. package/lib/index.js +1 -0
  30. package/lib/methods/index.d.ts +1 -0
  31. package/lib/methods/index.js +1 -0
  32. package/lib/methods/mulmo_beat.d.ts +6 -0
  33. package/lib/methods/mulmo_beat.js +21 -0
  34. package/lib/methods/mulmo_presentation_style.d.ts +3 -1
  35. package/lib/methods/mulmo_presentation_style.js +31 -7
  36. package/lib/methods/mulmo_studio_context.js +3 -0
  37. package/lib/tools/story_to_script.js +2 -2
  38. package/lib/types/agent.d.ts +55 -0
  39. package/lib/types/agent.js +3 -0
  40. package/lib/types/schema.d.ts +560 -296
  41. package/lib/types/schema.js +19 -10
  42. package/lib/types/type.d.ts +3 -2
  43. package/lib/utils/const.d.ts +0 -1
  44. package/lib/utils/const.js +0 -1
  45. package/lib/utils/context.d.ts +24 -13
  46. package/lib/utils/context.js +1 -0
  47. package/lib/utils/ffmpeg_utils.d.ts +1 -1
  48. package/lib/utils/ffmpeg_utils.js +1 -1
  49. package/lib/utils/file.js +4 -4
  50. package/lib/utils/filters.js +3 -4
  51. package/lib/utils/markdown.js +1 -1
  52. package/lib/utils/preprocess.d.ts +15 -8
  53. package/lib/utils/provider2agent.d.ts +72 -0
  54. package/lib/utils/provider2agent.js +81 -0
  55. package/lib/utils/string.js +5 -5
  56. package/lib/utils/utils.d.ts +13 -11
  57. package/lib/utils/utils.js +56 -62
  58. package/package.json +7 -6
  59. package/scripts/templates/html.json +42 -0
  60. package/scripts/templates/image_refs.json +35 -0
@@ -5,13 +5,13 @@ async function generateMovie(projectId, model, token, prompt, imagePath, aspectR
5
5
  const payload = {
6
6
  instances: [
7
7
  {
8
- prompt: prompt,
8
+ prompt,
9
9
  image: undefined,
10
10
  },
11
11
  ],
12
12
  parameters: {
13
13
  sampleCount: 1,
14
- aspectRatio: aspectRatio,
14
+ aspectRatio,
15
15
  safetySetting: "block_only_high",
16
16
  personGeneration: "allow_all",
17
17
  durationSeconds: duration,
@@ -46,7 +46,7 @@ async function generateMovie(projectId, model, token, prompt, imagePath, aspectR
46
46
  while (true) {
47
47
  GraphAILogger.info("...waiting for movie generation...");
48
48
  await sleep(3000);
49
- const response = await fetch(`${GOOGLE_IMAGEN_ENDPOINT}:fetchPredictOperation`, {
49
+ const operationResponse = await fetch(`${GOOGLE_IMAGEN_ENDPOINT}:fetchPredictOperation`, {
50
50
  method: "POST",
51
51
  headers: {
52
52
  Authorization: `Bearer ${token}`,
@@ -54,10 +54,10 @@ async function generateMovie(projectId, model, token, prompt, imagePath, aspectR
54
54
  },
55
55
  body: JSON.stringify(fetchBody),
56
56
  });
57
- if (!response.ok) {
58
- throw new Error(`Error: ${response.status} - ${response.statusText}`);
57
+ if (!operationResponse.ok) {
58
+ throw new Error(`Error: ${operationResponse.status} - ${operationResponse.statusText}`);
59
59
  }
60
- const responseData = await response.json();
60
+ const responseData = await operationResponse.json();
61
61
  if (responseData.done) {
62
62
  if (responseData.error) {
63
63
  GraphAILogger.info("Prompt: ", prompt);
@@ -87,7 +87,7 @@ export const getAspectRatio = (canvasSize) => {
87
87
  return "1:1";
88
88
  }
89
89
  };
90
- export const movieGoogleAgent = async ({ namedInputs, params, config }) => {
90
+ export const movieGoogleAgent = async ({ namedInputs, params, config, }) => {
91
91
  const { prompt, imagePath } = namedInputs;
92
92
  const aspectRatio = getAspectRatio(params.canvasSize);
93
93
  const model = params.model ?? "veo-2.0-generate-001"; // "veo-3.0-generate-preview";
@@ -1,23 +1,9 @@
1
1
  import type { AgentFunction, AgentFunctionInfo } from "graphai";
2
+ import type { AgentBufferResult, MovieAgentInputs, ReplicateMovieAgentParams, ReplicateMovieAgentConfig } from "../types/agent.js";
2
3
  export declare const getAspectRatio: (canvasSize: {
3
4
  width: number;
4
5
  height: number;
5
6
  }) => string;
6
- export type MovieReplicateConfig = {
7
- apiKey?: string;
8
- };
9
- export declare const movieReplicateAgent: AgentFunction<{
10
- model: `${string}/${string}` | undefined;
11
- canvasSize: {
12
- width: number;
13
- height: number;
14
- };
15
- duration?: number;
16
- }, {
17
- buffer: Buffer;
18
- }, {
19
- prompt: string;
20
- imagePath?: string;
21
- }, MovieReplicateConfig>;
7
+ export declare const movieReplicateAgent: AgentFunction<ReplicateMovieAgentParams, AgentBufferResult, MovieAgentInputs, ReplicateMovieAgentConfig>;
22
8
  declare const movieReplicateAgentInfo: AgentFunctionInfo;
23
9
  export default movieReplicateAgentInfo;
@@ -6,8 +6,8 @@ async function generateMovie(model, apiKey, prompt, imagePath, aspectRatio, dura
6
6
  auth: apiKey,
7
7
  });
8
8
  const input = {
9
- prompt: prompt,
10
- duration: duration,
9
+ prompt,
10
+ duration,
11
11
  image: undefined,
12
12
  start_image: undefined,
13
13
  aspect_ratio: aspectRatio, // only for bytedance/seedance-1-lite
@@ -21,7 +21,7 @@ async function generateMovie(model, apiKey, prompt, imagePath, aspectRatio, dura
21
21
  if (imagePath) {
22
22
  const buffer = readFileSync(imagePath);
23
23
  const base64Image = `data:image/png;base64,${buffer.toString("base64")}`;
24
- if (model === "kwaivgi/kling-v2.1") {
24
+ if (model === "kwaivgi/kling-v2.1" || model === "kwaivgi/kling-v1.6-pro") {
25
25
  input.start_image = base64Image;
26
26
  }
27
27
  else {
@@ -58,7 +58,7 @@ export const getAspectRatio = (canvasSize) => {
58
58
  return "1:1";
59
59
  }
60
60
  };
61
- export const movieReplicateAgent = async ({ namedInputs, params, config }) => {
61
+ export const movieReplicateAgent = async ({ namedInputs, params, config, }) => {
62
62
  const { prompt, imagePath } = namedInputs;
63
63
  const aspectRatio = getAspectRatio(params.canvasSize);
64
64
  const duration = params.duration ?? 5;
@@ -1,4 +1,12 @@
1
1
  import type { AgentFunction, AgentFunctionInfo } from "graphai";
2
- export declare const ttsGoogleAgent: AgentFunction;
2
+ export declare const ttsGoogleAgent: AgentFunction<{
3
+ voice: string;
4
+ speed: number;
5
+ suppressError: boolean;
6
+ }, {
7
+ buffer?: Buffer | null;
8
+ }, {
9
+ text: string;
10
+ }>;
3
11
  declare const ttsGoogleAgentInfo: AgentFunctionInfo;
4
12
  export default ttsGoogleAgentInfo;
@@ -14,7 +14,7 @@ export const ttsGoogleAgent = async ({ namedInputs, params }) => {
14
14
  }
15
15
  // Construct the request
16
16
  const request = {
17
- input: { text: text },
17
+ input: { text },
18
18
  voice: voiceParams,
19
19
  audioConfig: {
20
20
  audioEncoding: "MP3",
@@ -46,6 +46,6 @@ const ttsGoogleAgentInfo = {
46
46
  author: "Receptron Team",
47
47
  repository: "https://github.com/receptron/mulmocast-cli/",
48
48
  license: "MIT",
49
- environmentVariables: ["OPENAI_API_KEY"],
49
+ environmentVariables: ["GOOGLE_GENAI_API_KEY"],
50
50
  };
51
51
  export default ttsGoogleAgentInfo;
@@ -21,7 +21,7 @@ export const ttsNijivoiceAgent = async ({ params, namedInputs, config }) => {
21
21
  },
22
22
  body: JSON.stringify({
23
23
  format: "mp3",
24
- speed: speed ? "" + speed : speed_global ? "" + speed_global : "1.0",
24
+ speed: String(speed ?? speed_global ?? "1.0"),
25
25
  script: text,
26
26
  }),
27
27
  };
@@ -1,4 +1,16 @@
1
1
  import type { AgentFunction, AgentFunctionInfo } from "graphai";
2
- export declare const ttsOpenaiAgent: AgentFunction;
2
+ export declare const ttsOpenaiAgent: AgentFunction<{
3
+ model: string;
4
+ voice: string;
5
+ instructions: string;
6
+ suppressError: boolean;
7
+ }, {
8
+ buffer?: Buffer;
9
+ }, {
10
+ text: string;
11
+ }, {
12
+ baseURL?: string;
13
+ apiKey?: string;
14
+ }>;
3
15
  declare const ttsOpenaiAgentInfo: AgentFunctionInfo;
4
16
  export default ttsOpenaiAgentInfo;
@@ -3,8 +3,8 @@ import OpenAI from "openai";
3
3
  export const ttsOpenaiAgent = async ({ namedInputs, params, config }) => {
4
4
  const { text } = namedInputs;
5
5
  const { model, voice, suppressError, instructions } = params;
6
- const { apiKey } = config ?? {};
7
- const openai = new OpenAI({ apiKey });
6
+ const { apiKey, baseURL } = config ?? {};
7
+ const openai = new OpenAI({ apiKey, baseURL });
8
8
  try {
9
9
  const tts_options = {
10
10
  model: model ?? "gpt-4o-mini-tts", // "tts-1",
@@ -34,16 +34,16 @@ export const getFileObject = (args) => {
34
34
  const { fileOrUrl, fileName } = (() => {
35
35
  if (file === "__clipboard") {
36
36
  // We generate a new unique script file from clipboard text in the output directory
37
- const fileName = generateTimestampedFileName("script");
37
+ const generatedFileName = generateTimestampedFileName("script");
38
38
  const clipboardText = clipboardy.readSync();
39
- const fileOrUrl = resolveDirPath(outDirPath, `${fileName}.json`);
39
+ const resolvedFilePath = resolveDirPath(outDirPath, `${generatedFileName}.json`);
40
40
  mkdir(outDirPath);
41
- fs.writeFileSync(fileOrUrl, clipboardText, "utf8");
42
- return { fileOrUrl, fileName };
41
+ fs.writeFileSync(resolvedFilePath, clipboardText, "utf8");
42
+ return { fileOrUrl: resolvedFilePath, fileName: generatedFileName };
43
43
  }
44
- const fileOrUrl = file ?? "";
45
- const fileName = path.parse(fileOrUrl).name;
46
- return { fileOrUrl, fileName };
44
+ const resolvedFileOrUrl = file ?? "";
45
+ const parsedFileName = path.parse(resolvedFileOrUrl).name;
46
+ return { fileOrUrl: resolvedFileOrUrl, fileName: parsedFileName };
47
47
  })();
48
48
  const isHttpPath = isHttp(fileOrUrl);
49
49
  const mulmoFilePath = isHttpPath ? "" : getFullPath(baseDirPath, fileOrUrl);
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./actions/index.js";
2
2
  export * from "./cli/helpers.js";
3
3
  export * from "./utils/file.js";
4
4
  export * from "./utils/ffmpeg_utils.js";
5
+ export * from "./utils/provider2agent.js";
5
6
  export * from "./methods/index.js";
6
7
  export * from "./agents/index.js";
7
8
  export * from "./types/index.js";
package/lib/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./actions/index.js";
2
2
  export * from "./cli/helpers.js";
3
3
  export * from "./utils/file.js";
4
4
  export * from "./utils/ffmpeg_utils.js";
5
+ export * from "./utils/provider2agent.js";
5
6
  export * from "./methods/index.js";
6
7
  export * from "./agents/index.js";
7
8
  export * from "./types/index.js";
@@ -2,3 +2,4 @@ export * from "./mulmo_presentation_style.js";
2
2
  export * from "./mulmo_script_template.js";
3
3
  export * from "./mulmo_studio_context.js";
4
4
  export * from "./mulmo_media_source.js";
5
+ export * from "./mulmo_beat.js";
@@ -2,3 +2,4 @@ export * from "./mulmo_presentation_style.js";
2
2
  export * from "./mulmo_script_template.js";
3
3
  export * from "./mulmo_studio_context.js";
4
4
  export * from "./mulmo_media_source.js";
5
+ export * from "./mulmo_beat.js";
@@ -0,0 +1,6 @@
1
+ import { MulmoBeat } from "../types/index.js";
2
+ export declare const MulmoBeatMethods: {
3
+ getHtmlPrompt(beat: MulmoBeat): string | undefined;
4
+ getPlugin(beat: MulmoBeat): typeof import("../utils/image_plugins/text_slide.js") | typeof import("../utils/image_plugins/markdown.js") | typeof import("../utils/image_plugins/chart.js") | typeof import("../utils/image_plugins/mermaid.js") | typeof import("../utils/image_plugins/html_tailwind.js") | typeof import("../utils/image_plugins/image.js") | typeof import("../utils/image_plugins/movie.js") | typeof import("../utils/image_plugins/beat.js") | typeof import("../utils/image_plugins/voice_over.js");
5
+ getImageReferenceForImageGenerator(beat: MulmoBeat, imageRefs: Record<string, string>): string[];
6
+ };
@@ -0,0 +1,21 @@
1
+ import { findImagePlugin } from "../utils/image_plugins/index.js";
2
+ export const MulmoBeatMethods = {
3
+ getHtmlPrompt(beat) {
4
+ if (beat?.htmlPrompt?.data) {
5
+ return beat.htmlPrompt.prompt + "\n\n data\n" + JSON.stringify(beat.htmlPrompt.data, null, 2);
6
+ }
7
+ return beat?.htmlPrompt?.prompt;
8
+ },
9
+ getPlugin(beat) {
10
+ const plugin = findImagePlugin(beat?.image?.type);
11
+ if (!plugin) {
12
+ throw new Error(`invalid beat image type: ${beat.image}`);
13
+ }
14
+ return plugin;
15
+ },
16
+ getImageReferenceForImageGenerator(beat, imageRefs) {
17
+ const imageNames = beat.imageNames ?? Object.keys(imageRefs); // use all images if imageNames is not specified
18
+ const sources = imageNames.map((name) => imageRefs[name]);
19
+ return sources.filter((source) => source !== undefined);
20
+ },
21
+ };
@@ -7,10 +7,12 @@ export declare const MulmoPresentationStyleMethods: {
7
7
  getTextSlideStyle(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): string;
8
8
  getSpeechOptions(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): SpeechOptions | undefined;
9
9
  getSpeaker(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): SpeakerData;
10
- getProvider(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): Text2SpeechProvider;
10
+ getTTSProvider(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): Text2SpeechProvider;
11
11
  getVoiceId(presentationStyle: MulmoPresentationStyle, beat: MulmoBeat): string;
12
12
  getText2ImageProvider(provider: Text2ImageProvider | undefined): Text2ImageProvider;
13
13
  getImageAgentInfo(presentationStyle: MulmoPresentationStyle, beat?: MulmoBeat): Text2ImageAgentInfo;
14
+ getMovieAgent(presentationStyle: MulmoPresentationStyle): string;
15
+ getConcurrency(presentationStyle: MulmoPresentationStyle): 4 | 16;
14
16
  getHtmlImageAgentInfo(presentationStyle: MulmoPresentationStyle): Text2HtmlAgentInfo;
15
17
  getImageType(_: MulmoPresentationStyle, beat: MulmoBeat): BeatMediaType;
16
18
  };
@@ -1,7 +1,7 @@
1
1
  import "dotenv/config";
2
- import { userAssert, llmConfig } from "../utils/utils.js";
2
+ import { userAssert } from "../utils/utils.js";
3
3
  import { text2ImageProviderSchema, text2HtmlImageProviderSchema, text2SpeechProviderSchema, mulmoCanvasDimensionSchema } from "../types/schema.js";
4
- import { defaultOpenAIImageModel } from "../utils/const.js";
4
+ import { defaultProviders, provider2ImageAgent, provider2MovieAgent, provider2LLMAgent } from "../utils/provider2agent.js";
5
5
  const defaultTextSlideStyles = [
6
6
  '*,*::before,*::after{box-sizing:border-box}body,h1,h2,h3,h4,p,figure,blockquote,dl,dd{margin:0}ul[role="list"],ol[role="list"]{list-style:none}html:focus-within{scroll-behavior:smooth}body{min-height:100vh;text-rendering:optimizeSpeed;line-height:1.5}a:not([class]){text-decoration-skip-ink:auto}img,picture{max-width:100%;display:block}input,button,textarea,select{font:inherit}@media(prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}',
7
7
  "body { margin: 60px; margin-top: 40px; color:#333; font-size: 30px; font-family: Arial, sans-serif; box-sizing: border-box; height: 100vh }",
@@ -49,7 +49,7 @@ export const MulmoPresentationStyleMethods = {
49
49
  userAssert(!!speaker, `speaker is not set: speaker "${beat.speaker}"`);
50
50
  return speaker;
51
51
  },
52
- getProvider(presentationStyle, beat) {
52
+ getTTSProvider(presentationStyle, beat) {
53
53
  const speaker = MulmoPresentationStyleMethods.getSpeaker(presentationStyle, beat);
54
54
  return speaker.provider ?? presentationStyle.speechParams.provider;
55
55
  },
@@ -65,22 +65,46 @@ export const MulmoPresentationStyleMethods = {
65
65
  // provider and model appropriately.
66
66
  const imageParams = { ...presentationStyle.imageParams, ...beat?.imageParams };
67
67
  const provider = MulmoPresentationStyleMethods.getText2ImageProvider(imageParams?.provider);
68
+ const agentInfo = provider2ImageAgent[provider];
69
+ // The default text2image model is gpt-image-1 from OpenAI, and to use it you must have an OpenAI account and have verified your identity. If this is not possible, please specify dall-e-3 as the model.
68
70
  const defaultImageParams = {
69
71
  provider,
70
- model: provider === "openai" ? (process.env.DEFAULT_OPENAI_IMAGE_MODEL ?? defaultOpenAIImageModel) : undefined,
72
+ model: agentInfo.defaultModel,
71
73
  };
72
74
  return {
73
- agent: provider === "google" ? "imageGoogleAgent" : "imageOpenaiAgent",
75
+ agent: agentInfo.agentName,
74
76
  imageParams: { ...defaultImageParams, ...imageParams },
75
77
  };
76
78
  },
79
+ // Determine movie agent based on provider
80
+ getMovieAgent(presentationStyle) {
81
+ const movieProvider = (presentationStyle.movieParams?.provider ?? defaultProviders.text2movie);
82
+ return provider2MovieAgent[movieProvider].agentName;
83
+ },
84
+ getConcurrency(presentationStyle) {
85
+ /*
86
+ if (presentationStyle.movieParams?.provider === "replicate") {
87
+ return 4;
88
+ }
89
+ */
90
+ const imageAgentInfo = MulmoPresentationStyleMethods.getImageAgentInfo(presentationStyle);
91
+ if (imageAgentInfo.imageParams.provider === "openai") {
92
+ // NOTE: Here are the rate limits of OpenAI's text2image API (1token = 32x32 patch).
93
+ // dall-e-3: 7,500 RPM、15 images per minute (4 images for max resolution)
94
+ // gpt-image-1:3,000,000 TPM、150 images per minute
95
+ if (imageAgentInfo.imageParams.model === provider2ImageAgent.openai.defaultModel) {
96
+ return 16;
97
+ }
98
+ }
99
+ return 4;
100
+ },
77
101
  getHtmlImageAgentInfo(presentationStyle) {
78
102
  const provider = text2HtmlImageProviderSchema.parse(presentationStyle.htmlImageParams?.provider);
79
- const defaultConfig = llmConfig[provider];
103
+ const defaultConfig = provider2LLMAgent[provider];
80
104
  const model = presentationStyle.htmlImageParams?.model ? presentationStyle.htmlImageParams?.model : defaultConfig.defaultModel;
81
105
  return {
82
106
  provider,
83
- agent: defaultConfig.agent,
107
+ agent: defaultConfig.agentName,
84
108
  model,
85
109
  max_tokens: defaultConfig.max_tokens,
86
110
  };
@@ -52,6 +52,9 @@ export const MulmoStudioContextMethods = {
52
52
  },
53
53
  setBeatSessionState(context, sessionType, index, value) {
54
54
  if (value) {
55
+ if (!context.sessionState.inBeatSession[sessionType]) {
56
+ context.sessionState.inBeatSession[sessionType] = {};
57
+ }
55
58
  context.sessionState.inBeatSession[sessionType][index] = true;
56
59
  }
57
60
  else {
@@ -28,7 +28,7 @@ const createValidatedScriptGraphData = ({ systemPrompt, prompt, schema, llmAgent
28
28
  inputs: {
29
29
  model: llmModel,
30
30
  system: systemPrompt,
31
- prompt: prompt,
31
+ prompt,
32
32
  max_tokens: maxTokens,
33
33
  },
34
34
  },
@@ -36,7 +36,7 @@ const createValidatedScriptGraphData = ({ systemPrompt, prompt, schema, llmAgent
36
36
  agent: "validateSchemaAgent",
37
37
  inputs: {
38
38
  text: ":llm.text.codeBlock()",
39
- schema: schema,
39
+ schema,
40
40
  },
41
41
  isResult: true,
42
42
  },
@@ -0,0 +1,55 @@
1
+ export type OpenAIImageSize = "1792x1024" | "1024x1792" | "1024x1024" | "1536x1024" | "1024x1536";
2
+ export type OpenAIImageModeration = "low" | "auto";
3
+ export type OpenAIImageOptions = {
4
+ model: string;
5
+ prompt: string;
6
+ n: number;
7
+ size: OpenAIImageSize;
8
+ moderation?: OpenAIImageModeration;
9
+ };
10
+ export type AgentBufferResult = {
11
+ buffer: Buffer;
12
+ };
13
+ export type AgentPromptInputs = {
14
+ prompt: string;
15
+ };
16
+ export type ImageAgentInputs = AgentPromptInputs;
17
+ export type OpenAIImageAgentInputs = AgentPromptInputs & {
18
+ referenceImages: string[] | null | undefined;
19
+ };
20
+ export type ImageAgentParams = {
21
+ model: string;
22
+ canvasSize: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ };
27
+ export type OpenAIImageAgentParams = ImageAgentParams & {
28
+ moderation: OpenAIImageModeration | null | undefined;
29
+ };
30
+ export type OpenAIImageAgentConfig = {
31
+ baseURL?: string;
32
+ apiKey?: string;
33
+ };
34
+ export type GoogleImageAgentConfig = {
35
+ projectId?: string;
36
+ token?: string;
37
+ };
38
+ export type MovieAgentInputs = AgentPromptInputs & {
39
+ imagePath?: string;
40
+ };
41
+ export type GoogleMovieAgentParams = ImageAgentParams & {
42
+ duration?: number;
43
+ };
44
+ export type ReplicateMovieAgentParams = {
45
+ model: `${string}/${string}` | undefined;
46
+ canvasSize: {
47
+ width: number;
48
+ height: number;
49
+ };
50
+ duration?: number;
51
+ };
52
+ export type GoogleMovieAgentConfig = GoogleImageAgentConfig;
53
+ export type ReplicateMovieAgentConfig = {
54
+ apiKey?: string;
55
+ };
@@ -0,0 +1,3 @@
1
+ // for image agent
2
+ export {};
3
+ // end of image agent