mulmocast 1.2.12 → 1.2.13
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.
|
@@ -50,4 +50,6 @@ export declare const getOutputMultilingualFilePathAndMkdir: (context: MulmoStudi
|
|
|
50
50
|
outDirPath: string;
|
|
51
51
|
};
|
|
52
52
|
export declare const translateBeat: (index: number, context: MulmoStudioContext, targetLangs: string[], args?: PublicAPIArgs) => Promise<void>;
|
|
53
|
-
export declare const translate: (context: MulmoStudioContext, args?: PublicAPIArgs
|
|
53
|
+
export declare const translate: (context: MulmoStudioContext, args?: PublicAPIArgs & {
|
|
54
|
+
targetLangs?: string[];
|
|
55
|
+
}) => Promise<MulmoStudioContext>;
|
package/lib/actions/translate.js
CHANGED
|
@@ -270,7 +270,9 @@ export const translate = async (context, args) => {
|
|
|
270
270
|
try {
|
|
271
271
|
MulmoStudioContextMethods.setSessionState(context, "multiLingual", true);
|
|
272
272
|
const { outputMultilingualFilePath, outDirPath } = getOutputMultilingualFilePathAndMkdir(context);
|
|
273
|
-
const targetLangs =
|
|
273
|
+
const targetLangs = args?.targetLangs
|
|
274
|
+
? args?.targetLangs
|
|
275
|
+
: [...new Set([context.lang, context.studio.script.captionParams?.lang].filter((x) => !isNull(x)))];
|
|
274
276
|
const config = settings2GraphAIConfig(settings, process.env);
|
|
275
277
|
assert(!!config?.openAIAgent?.apiKey, "The OPENAI_API_KEY environment variable is missing or empty");
|
|
276
278
|
const graph = new GraphAI(translateGraph, { ...vanillaAgents, fileWriteAgent, openAIAgent }, { agentFilters, config });
|