@mux/ai 0.38.0 → 0.40.0
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/{index-BupL84pY.d.ts → index-UhRs9t1h.d.ts} +17 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +22 -37
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/index.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.js +21 -36
- package/dist/workflows/index.js.map +1 -1
- package/package.json +17 -3
|
@@ -267,6 +267,14 @@ interface EmbeddingModelIdByProvider {
|
|
|
267
267
|
* asynchronous job failure.
|
|
268
268
|
*/
|
|
269
269
|
declare const ASK_QUESTIONS_MAX_QUESTION_LENGTH = 600;
|
|
270
|
+
/**
|
|
271
|
+
* Maximum number of questions allowed in a single call. Not configurable.
|
|
272
|
+
*
|
|
273
|
+
* Exported so API layers wrapping this workflow can mirror the limit in
|
|
274
|
+
* their own request validation instead of surfacing it as an
|
|
275
|
+
* asynchronous job failure.
|
|
276
|
+
*/
|
|
277
|
+
declare const ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL = 50;
|
|
270
278
|
/**
|
|
271
279
|
* Default for {@link AskQuestionsOptions.maxAnswerOptionLength}.
|
|
272
280
|
*
|
|
@@ -399,16 +407,16 @@ declare const questionAnswerSchema: z.ZodObject<{
|
|
|
399
407
|
reasoning: z.ZodString;
|
|
400
408
|
skipped: z.ZodBoolean;
|
|
401
409
|
}, "strip", z.ZodTypeAny, {
|
|
402
|
-
reasoning: string;
|
|
403
410
|
question: string;
|
|
404
411
|
answer: string | null;
|
|
405
412
|
confidence: number;
|
|
413
|
+
reasoning: string;
|
|
406
414
|
skipped: boolean;
|
|
407
415
|
}, {
|
|
408
|
-
reasoning: string;
|
|
409
416
|
question: string;
|
|
410
417
|
answer: string | null;
|
|
411
418
|
confidence: number;
|
|
419
|
+
reasoning: string;
|
|
412
420
|
skipped: boolean;
|
|
413
421
|
}>;
|
|
414
422
|
type QuestionAnswerType = z.infer<typeof questionAnswerSchema>;
|
|
@@ -426,32 +434,32 @@ declare function createAskQuestionsSchema(answerSchema: z.ZodType<string>): z.Zo
|
|
|
426
434
|
} & {
|
|
427
435
|
answer: z.ZodType<string, z.ZodTypeDef, string>;
|
|
428
436
|
}, "strip", z.ZodTypeAny, {
|
|
429
|
-
reasoning: string;
|
|
430
437
|
question: string;
|
|
431
438
|
answer: string;
|
|
432
439
|
confidence: number;
|
|
440
|
+
reasoning: string;
|
|
433
441
|
skipped: boolean;
|
|
434
442
|
}, {
|
|
435
|
-
reasoning: string;
|
|
436
443
|
question: string;
|
|
437
444
|
answer: string;
|
|
438
445
|
confidence: number;
|
|
446
|
+
reasoning: string;
|
|
439
447
|
skipped: boolean;
|
|
440
448
|
}>, "many">;
|
|
441
449
|
}, "strip", z.ZodTypeAny, {
|
|
442
450
|
answers: {
|
|
443
|
-
reasoning: string;
|
|
444
451
|
question: string;
|
|
445
452
|
answer: string;
|
|
446
453
|
confidence: number;
|
|
454
|
+
reasoning: string;
|
|
447
455
|
skipped: boolean;
|
|
448
456
|
}[];
|
|
449
457
|
}, {
|
|
450
458
|
answers: {
|
|
451
|
-
reasoning: string;
|
|
452
459
|
question: string;
|
|
453
460
|
answer: string;
|
|
454
461
|
confidence: number;
|
|
462
|
+
reasoning: string;
|
|
455
463
|
skipped: boolean;
|
|
456
464
|
}[];
|
|
457
465
|
}>;
|
|
@@ -1519,6 +1527,7 @@ declare function translateCaptions<P extends SupportedProvider = SupportedProvid
|
|
|
1519
1527
|
|
|
1520
1528
|
declare const index_ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH: typeof ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH;
|
|
1521
1529
|
declare const index_ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH: typeof ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH;
|
|
1530
|
+
declare const index_ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL: typeof ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL;
|
|
1522
1531
|
declare const index_ASK_QUESTIONS_MAX_QUESTION_LENGTH: typeof ASK_QUESTIONS_MAX_QUESTION_LENGTH;
|
|
1523
1532
|
type index_AskQuestionsOptions = AskQuestionsOptions;
|
|
1524
1533
|
type index_AskQuestionsResult = AskQuestionsResult;
|
|
@@ -1609,7 +1618,7 @@ declare const index_translationSchema: typeof translationSchema;
|
|
|
1609
1618
|
declare const index_validateNeverTranslateTerms: typeof validateNeverTranslateTerms;
|
|
1610
1619
|
declare const index_verifyNeverTranslateTerms: typeof verifyNeverTranslateTerms;
|
|
1611
1620
|
declare namespace index {
|
|
1612
|
-
export { index_ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH, index_ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH, index_ASK_QUESTIONS_MAX_QUESTION_LENGTH as ASK_QUESTIONS_MAX_QUESTION_LENGTH, type index_AskQuestionsOptions as AskQuestionsOptions, type index_AskQuestionsResult as AskQuestionsResult, type index_AskQuestionsType as AskQuestionsType, type index_AudioTranslationOptions as AudioTranslationOptions, type index_AudioTranslationResult as AudioTranslationResult, type index_AutoCensorProfanityOptions as AutoCensorProfanityOptions, type index_BurnedInCaptionsAnalysis as BurnedInCaptionsAnalysis, type index_BurnedInCaptionsOptions as BurnedInCaptionsOptions, type index_BurnedInCaptionsPromptOverrides as BurnedInCaptionsPromptOverrides, type index_BurnedInCaptionsPromptSections as BurnedInCaptionsPromptSections, type index_BurnedInCaptionsResult as BurnedInCaptionsResult, type index_CaptionReplacement as CaptionReplacement, type index_CensorMode as CensorMode, type index_Chapter as Chapter, type index_ChapterSystemPromptSections as ChapterSystemPromptSections, type index_ChaptersOptions as ChaptersOptions, type index_ChaptersPromptOverrides as ChaptersPromptOverrides, type index_ChaptersPromptSections as ChaptersPromptSections, type index_ChaptersResult as ChaptersResult, type index_ChaptersType as ChaptersType, index_DEFAULT_DESCRIPTION_LENGTH as DEFAULT_DESCRIPTION_LENGTH, index_DEFAULT_SUMMARY_KEYWORD_LIMIT as DEFAULT_SUMMARY_KEYWORD_LIMIT, index_DEFAULT_TITLE_LENGTH as DEFAULT_TITLE_LENGTH, type index_EditCaptionsOptions as EditCaptionsOptions, type index_EditCaptionsResult as EditCaptionsResult, type index_EmbeddingsOptions as EmbeddingsOptions, type index_EmbeddingsResult as EmbeddingsResult, type index_EngagementInsightsOptions as EngagementInsightsOptions, type index_EngagementInsightsResult as EngagementInsightsResult, index_GOOGLE_VISION_LIKELIHOOD_TO_SCORE as GOOGLE_VISION_LIKELIHOOD_TO_SCORE, index_HIVE_SEXUAL_CATEGORIES as HIVE_SEXUAL_CATEGORIES, index_HIVE_VIOLENCE_CATEGORIES as HIVE_VIOLENCE_CATEGORIES, type index_HiveModerationOutput as HiveModerationOutput, type index_HiveModerationSource as HiveModerationSource, type index_ModerationOptions as ModerationOptions, type index_ModerationProvider as ModerationProvider, type index_ModerationResult as ModerationResult, type index_MomentInsight as MomentInsight, type index_OverallInsight as OverallInsight, type index_ProfanityDetectionPayload as ProfanityDetectionPayload, type index_Question as Question, type index_QuestionAnswer as QuestionAnswer, type index_QuestionAnswerType as QuestionAnswerType, type index_ReplacementRecord as ReplacementRecord, type index_SpeakerReplacement as SpeakerReplacement, type index_StaticRenditionCleanupOutcome as StaticRenditionCleanupOutcome, type index_SummarizationOptions as SummarizationOptions, type index_SummarizationPromptOverrides as SummarizationPromptOverrides, type index_SummarizationPromptSections as SummarizationPromptSections, type index_SummaryAndTagsResult as SummaryAndTagsResult, type index_SummaryType as SummaryType, type index_ThumbnailModerationScore as ThumbnailModerationScore, type index_TranslationChunkingOptions as TranslationChunkingOptions, type index_TranslationOptions as TranslationOptions, type index_TranslationPayload as TranslationPayload, type index_TranslationResult as TranslationResult, index_aggregateTokenUsage as aggregateTokenUsage, index_applyOverrideLists as applyOverrideLists, index_applyReplacements as applyReplacements, index_applySpeakerReplacements as applySpeakerReplacements, index_askQuestions as askQuestions, index_buildReplacementRegex as buildReplacementRegex, index_burnedInCaptionsSchema as burnedInCaptionsSchema, index_censorVttContent as censorVttContent, index_chapterSchema as chapterSchema, index_chaptersSchema as chaptersSchema, index_createReplacer as createReplacer, index_editCaptions as editCaptions, index_extractTranscriptSegmentsForHotspots as extractTranscriptSegmentsForHotspots, index_generateChapters as generateChapters, index_generateEmbeddings as generateEmbeddings, index_generateEngagementInsights as generateEngagementInsights, index_generateVideoEmbeddings as generateVideoEmbeddings, index_getModerationScores as getModerationScores, index_getSummaryAndTags as getSummaryAndTags, index_hasBurnedInCaptions as hasBurnedInCaptions, index_mapShotsToHotspots as mapShotsToHotspots, index_normalizeTranslatedVtt as normalizeTranslatedVtt, index_profanityDetectionSchema as profanityDetectionSchema, index_questionAnswerSchema as questionAnswerSchema, index_shouldSplitChunkTranslationError as shouldSplitChunkTranslationError, index_summarySchema as summarySchema, index_transformCueText as transformCueText, index_translateAudio as translateAudio, index_translateCaptions as translateCaptions, index_translationSchema as translationSchema, index_validateNeverTranslateTerms as validateNeverTranslateTerms, index_verifyNeverTranslateTerms as verifyNeverTranslateTerms };
|
|
1621
|
+
export { index_ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH, index_ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH, index_ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL, index_ASK_QUESTIONS_MAX_QUESTION_LENGTH as ASK_QUESTIONS_MAX_QUESTION_LENGTH, type index_AskQuestionsOptions as AskQuestionsOptions, type index_AskQuestionsResult as AskQuestionsResult, type index_AskQuestionsType as AskQuestionsType, type index_AudioTranslationOptions as AudioTranslationOptions, type index_AudioTranslationResult as AudioTranslationResult, type index_AutoCensorProfanityOptions as AutoCensorProfanityOptions, type index_BurnedInCaptionsAnalysis as BurnedInCaptionsAnalysis, type index_BurnedInCaptionsOptions as BurnedInCaptionsOptions, type index_BurnedInCaptionsPromptOverrides as BurnedInCaptionsPromptOverrides, type index_BurnedInCaptionsPromptSections as BurnedInCaptionsPromptSections, type index_BurnedInCaptionsResult as BurnedInCaptionsResult, type index_CaptionReplacement as CaptionReplacement, type index_CensorMode as CensorMode, type index_Chapter as Chapter, type index_ChapterSystemPromptSections as ChapterSystemPromptSections, type index_ChaptersOptions as ChaptersOptions, type index_ChaptersPromptOverrides as ChaptersPromptOverrides, type index_ChaptersPromptSections as ChaptersPromptSections, type index_ChaptersResult as ChaptersResult, type index_ChaptersType as ChaptersType, index_DEFAULT_DESCRIPTION_LENGTH as DEFAULT_DESCRIPTION_LENGTH, index_DEFAULT_SUMMARY_KEYWORD_LIMIT as DEFAULT_SUMMARY_KEYWORD_LIMIT, index_DEFAULT_TITLE_LENGTH as DEFAULT_TITLE_LENGTH, type index_EditCaptionsOptions as EditCaptionsOptions, type index_EditCaptionsResult as EditCaptionsResult, type index_EmbeddingsOptions as EmbeddingsOptions, type index_EmbeddingsResult as EmbeddingsResult, type index_EngagementInsightsOptions as EngagementInsightsOptions, type index_EngagementInsightsResult as EngagementInsightsResult, index_GOOGLE_VISION_LIKELIHOOD_TO_SCORE as GOOGLE_VISION_LIKELIHOOD_TO_SCORE, index_HIVE_SEXUAL_CATEGORIES as HIVE_SEXUAL_CATEGORIES, index_HIVE_VIOLENCE_CATEGORIES as HIVE_VIOLENCE_CATEGORIES, type index_HiveModerationOutput as HiveModerationOutput, type index_HiveModerationSource as HiveModerationSource, type index_ModerationOptions as ModerationOptions, type index_ModerationProvider as ModerationProvider, type index_ModerationResult as ModerationResult, type index_MomentInsight as MomentInsight, type index_OverallInsight as OverallInsight, type index_ProfanityDetectionPayload as ProfanityDetectionPayload, type index_Question as Question, type index_QuestionAnswer as QuestionAnswer, type index_QuestionAnswerType as QuestionAnswerType, type index_ReplacementRecord as ReplacementRecord, type index_SpeakerReplacement as SpeakerReplacement, type index_StaticRenditionCleanupOutcome as StaticRenditionCleanupOutcome, type index_SummarizationOptions as SummarizationOptions, type index_SummarizationPromptOverrides as SummarizationPromptOverrides, type index_SummarizationPromptSections as SummarizationPromptSections, type index_SummaryAndTagsResult as SummaryAndTagsResult, type index_SummaryType as SummaryType, type index_ThumbnailModerationScore as ThumbnailModerationScore, type index_TranslationChunkingOptions as TranslationChunkingOptions, type index_TranslationOptions as TranslationOptions, type index_TranslationPayload as TranslationPayload, type index_TranslationResult as TranslationResult, index_aggregateTokenUsage as aggregateTokenUsage, index_applyOverrideLists as applyOverrideLists, index_applyReplacements as applyReplacements, index_applySpeakerReplacements as applySpeakerReplacements, index_askQuestions as askQuestions, index_buildReplacementRegex as buildReplacementRegex, index_burnedInCaptionsSchema as burnedInCaptionsSchema, index_censorVttContent as censorVttContent, index_chapterSchema as chapterSchema, index_chaptersSchema as chaptersSchema, index_createReplacer as createReplacer, index_editCaptions as editCaptions, index_extractTranscriptSegmentsForHotspots as extractTranscriptSegmentsForHotspots, index_generateChapters as generateChapters, index_generateEmbeddings as generateEmbeddings, index_generateEngagementInsights as generateEngagementInsights, index_generateVideoEmbeddings as generateVideoEmbeddings, index_getModerationScores as getModerationScores, index_getSummaryAndTags as getSummaryAndTags, index_hasBurnedInCaptions as hasBurnedInCaptions, index_mapShotsToHotspots as mapShotsToHotspots, index_normalizeTranslatedVtt as normalizeTranslatedVtt, index_profanityDetectionSchema as profanityDetectionSchema, index_questionAnswerSchema as questionAnswerSchema, index_shouldSplitChunkTranslationError as shouldSplitChunkTranslationError, index_summarySchema as summarySchema, index_transformCueText as transformCueText, index_translateAudio as translateAudio, index_translateCaptions as translateCaptions, index_translationSchema as translationSchema, index_validateNeverTranslateTerms as validateNeverTranslateTerms, index_verifyNeverTranslateTerms as verifyNeverTranslateTerms };
|
|
1613
1622
|
}
|
|
1614
1623
|
|
|
1615
|
-
export { type
|
|
1624
|
+
export { type ModerationResult as $, ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH as A, type BurnedInCaptionsAnalysis as B, type CaptionReplacement as C, type ChaptersOptions as D, type ChaptersPromptOverrides as E, type ChaptersPromptSections as F, type ChaptersResult as G, type ChaptersType as H, type ISO639_1 as I, DEFAULT_DESCRIPTION_LENGTH as J, DEFAULT_SUMMARY_KEYWORD_LIMIT as K, type LanguageCodePair as L, DEFAULT_TITLE_LENGTH as M, type EditCaptionsOptions as N, type EditCaptionsResult as O, type EmbeddingsOptions as P, type EmbeddingsResult as Q, type EngagementInsightsOptions as R, type SupportedISO639_1 as S, type EngagementInsightsResult as T, GOOGLE_VISION_LIKELIHOOD_TO_SCORE as U, HIVE_SEXUAL_CATEGORIES as V, HIVE_VIOLENCE_CATEGORIES as W, type HiveModerationOutput as X, type HiveModerationSource as Y, type ModerationOptions as Z, type ModerationProvider as _, type ISO639_3 as a, type MomentInsight as a0, type OverallInsight as a1, type ProfanityDetectionPayload as a2, type Question as a3, type QuestionAnswer as a4, type QuestionAnswerType as a5, type ReplacementRecord as a6, type SpeakerReplacement as a7, type StaticRenditionCleanupOutcome as a8, type SummarizationOptions as a9, getModerationScores as aA, getSummaryAndTags as aB, hasBurnedInCaptions as aC, mapShotsToHotspots as aD, normalizeTranslatedVtt as aE, profanityDetectionSchema as aF, questionAnswerSchema as aG, shouldSplitChunkTranslationError as aH, summarySchema as aI, transformCueText as aJ, translateAudio as aK, translateCaptions as aL, translationSchema as aM, validateNeverTranslateTerms as aN, verifyNeverTranslateTerms as aO, type SummarizationPromptOverrides as aa, type SummarizationPromptSections as ab, type SummaryAndTagsResult as ac, type SummaryType as ad, type ThumbnailModerationScore as ae, type TranslationChunkingOptions as af, type TranslationOptions as ag, type TranslationPayload as ah, type TranslationResult as ai, aggregateTokenUsage as aj, applyOverrideLists as ak, applyReplacements as al, applySpeakerReplacements as am, askQuestions as an, buildReplacementRegex as ao, burnedInCaptionsSchema as ap, censorVttContent as aq, chapterSchema as ar, chaptersSchema as as, createReplacer as at, editCaptions as au, extractTranscriptSegmentsForHotspots as av, generateChapters as aw, generateEmbeddings as ax, generateEngagementInsights as ay, generateVideoEmbeddings as az, type SupportedISO639_3 as b, getLanguageName as c, isValidISO639_1 as d, isValidISO639_3 as e, toISO639_3 as f, getLanguageCodePair as g, index as h, isUndeterminedLanguageCode as i, ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH as j, ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL as k, ASK_QUESTIONS_MAX_QUESTION_LENGTH as l, type AskQuestionsOptions as m, type AskQuestionsResult as n, type AskQuestionsType as o, type AudioTranslationOptions as p, type AudioTranslationResult as q, type AutoCensorProfanityOptions as r, type BurnedInCaptionsOptions as s, toISO639_1 as t, type BurnedInCaptionsPromptOverrides as u, type BurnedInCaptionsPromptSections as v, type BurnedInCaptionsResult as w, type CensorMode as x, type Chapter as y, type ChapterSystemPromptSections as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, S as SupportedISO639_1, b as SupportedISO639_3, g as getLanguageCodePair, c as getLanguageName, i as isUndeterminedLanguageCode, d as isValidISO639_1, e as isValidISO639_3, t as toISO639_1, f as toISO639_3, h as workflows } from './index-
|
|
1
|
+
export { I as ISO639_1, a as ISO639_3, L as LanguageCodePair, S as SupportedISO639_1, b as SupportedISO639_3, g as getLanguageCodePair, c as getLanguageName, i as isUndeterminedLanguageCode, d as isValidISO639_1, e as isValidISO639_3, t as toISO639_1, f as toISO639_3, h as workflows } from './index-UhRs9t1h.js';
|
|
2
2
|
import { W as WorkflowCredentials, S as StoragePutObjectInput, a as StoragePresignGetObjectInput } from './shots-CUI09Ohe.js';
|
|
3
3
|
export { A as AssetTextTrack, C as ChunkEmbedding, b as ChunkingStrategy, E as Encrypted, c as EncryptedPayload, I as ImageSubmissionMode, M as MuxAIOptions, d as MuxAsset, P as PlaybackAsset, e as PlaybackPolicy, f as ScopedMuxAIOptions, g as StorageAdapter, T as TextChunk, h as TokenChunkingConfig, i as TokenUsage, j as ToneType, U as UsageMetadata, V as VTTChunkingConfig, k as VideoEmbeddingsResult, l as WorkflowCredentialsInput, m as WorkflowMuxClient, n as WorkflowScope, o as decryptFromWorkflow, p as encryptForWorkflow } from './shots-CUI09Ohe.js';
|
|
4
4
|
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
|
|
@@ -9,7 +9,7 @@ import '@ai-sdk/google';
|
|
|
9
9
|
import '@ai-sdk/openai';
|
|
10
10
|
import '@mux/mux-node';
|
|
11
11
|
|
|
12
|
-
var version = "0.
|
|
12
|
+
var version = "0.40.0";
|
|
13
13
|
|
|
14
14
|
type MuxAiErrorType = "validation_error" | "processing_error" | "timeout_error" | "content_policy_error";
|
|
15
15
|
/**
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// package.json
|
|
8
|
-
var version = "0.
|
|
8
|
+
var version = "0.40.0";
|
|
9
9
|
|
|
10
10
|
// src/lib/language-codes.ts
|
|
11
11
|
var ISO639_1_TO_3 = {
|
|
@@ -212,6 +212,10 @@ var EnvSchema = z.object({
|
|
|
212
212
|
"Override for Mux stream base URL (defaults to https://stream.mux.com).",
|
|
213
213
|
"Mux stream URL override"
|
|
214
214
|
),
|
|
215
|
+
MUX_BASE_URL: optionalString(
|
|
216
|
+
"Override for the Mux API base URL (defaults to https://api.mux.com).",
|
|
217
|
+
"Mux API base URL override"
|
|
218
|
+
),
|
|
215
219
|
// The canary is substring-matched against every LLM output via
|
|
216
220
|
// `detectLeakReason` ("canary" reason). A too-short override (e.g. a
|
|
217
221
|
// 3-letter test value like "mux" or "the") would match legitimate
|
|
@@ -3012,6 +3016,7 @@ var workflows_exports = {};
|
|
|
3012
3016
|
__export(workflows_exports, {
|
|
3013
3017
|
ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH: () => ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH,
|
|
3014
3018
|
ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH: () => ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH,
|
|
3019
|
+
ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL: () => ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL,
|
|
3015
3020
|
ASK_QUESTIONS_MAX_QUESTION_LENGTH: () => ASK_QUESTIONS_MAX_QUESTION_LENGTH,
|
|
3016
3021
|
DEFAULT_DESCRIPTION_LENGTH: () => DEFAULT_DESCRIPTION_LENGTH,
|
|
3017
3022
|
DEFAULT_SUMMARY_KEYWORD_LIMIT: () => DEFAULT_SUMMARY_KEYWORD_LIMIT,
|
|
@@ -3489,6 +3494,7 @@ function createLanguageSection(languageName) {
|
|
|
3489
3494
|
|
|
3490
3495
|
// src/workflows/ask-questions.ts
|
|
3491
3496
|
var ASK_QUESTIONS_MAX_QUESTION_LENGTH = 600;
|
|
3497
|
+
var ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL = 50;
|
|
3492
3498
|
var ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH = 150;
|
|
3493
3499
|
var ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH = 500;
|
|
3494
3500
|
var questionAnswerSchema = z3.object({
|
|
@@ -3891,11 +3897,8 @@ async function analyzeQuestions({
|
|
|
3891
3897
|
maxRetries: 0,
|
|
3892
3898
|
output: Output.object({ schema: responseSchema }),
|
|
3893
3899
|
experimental_telemetry: { isEnabled: true },
|
|
3900
|
+
system: systemPrompt,
|
|
3894
3901
|
messages: [
|
|
3895
|
-
{
|
|
3896
|
-
role: "system",
|
|
3897
|
-
content: systemPrompt
|
|
3898
|
-
},
|
|
3899
3902
|
{
|
|
3900
3903
|
role: "user",
|
|
3901
3904
|
content: imageDataUrl ? [
|
|
@@ -3951,6 +3954,12 @@ async function askQuestionsInternal(assetId, questions, options, collectedUsage)
|
|
|
3951
3954
|
if (!questions || questions.length === 0) {
|
|
3952
3955
|
throw new MuxAiError("At least one question must be provided.", { type: "validation_error" });
|
|
3953
3956
|
}
|
|
3957
|
+
if (questions.length > ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL) {
|
|
3958
|
+
throw new MuxAiError(
|
|
3959
|
+
`Too many questions: received ${questions.length}, but at most ${ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL} are allowed per call.`,
|
|
3960
|
+
{ type: "validation_error" }
|
|
3961
|
+
);
|
|
3962
|
+
}
|
|
3954
3963
|
questions.forEach((q, idx) => {
|
|
3955
3964
|
if (!q.question || typeof q.question !== "string" || !q.question.trim()) {
|
|
3956
3965
|
throw new MuxAiError(
|
|
@@ -4303,11 +4312,8 @@ async function analyzeStoryboard({
|
|
|
4303
4312
|
maxRetries: 0,
|
|
4304
4313
|
output: Output2.object({ schema: burnedInCaptionsSchema }),
|
|
4305
4314
|
experimental_telemetry: { isEnabled: true },
|
|
4315
|
+
system: systemPrompt,
|
|
4306
4316
|
messages: [
|
|
4307
|
-
{
|
|
4308
|
-
role: "system",
|
|
4309
|
-
content: systemPrompt
|
|
4310
|
-
},
|
|
4311
4317
|
{
|
|
4312
4318
|
role: "user",
|
|
4313
4319
|
content: [
|
|
@@ -4452,11 +4458,8 @@ async function generateChaptersWithAI({
|
|
|
4452
4458
|
model,
|
|
4453
4459
|
maxRetries: 0,
|
|
4454
4460
|
output: Output3.object({ schema: chaptersSchema }),
|
|
4461
|
+
system: systemPrompt,
|
|
4455
4462
|
messages: [
|
|
4456
|
-
{
|
|
4457
|
-
role: "system",
|
|
4458
|
-
content: systemPrompt
|
|
4459
|
-
},
|
|
4460
4463
|
{
|
|
4461
4464
|
role: "user",
|
|
4462
4465
|
content: userPrompt
|
|
@@ -5016,11 +5019,8 @@ async function identifyProfanityWithAI({
|
|
|
5016
5019
|
model,
|
|
5017
5020
|
maxRetries: 0,
|
|
5018
5021
|
output: Output4.object({ schema: profanityDetectionSchema }),
|
|
5022
|
+
system: SYSTEM_PROMPT3,
|
|
5019
5023
|
messages: [
|
|
5020
|
-
{
|
|
5021
|
-
role: "system",
|
|
5022
|
-
content: SYSTEM_PROMPT3
|
|
5023
|
-
},
|
|
5024
5024
|
{
|
|
5025
5025
|
role: "user",
|
|
5026
5026
|
content: `Identify all profane words and phrases in the following subtitle transcript. Return each unique profane word or phrase exactly as it appears in the text.
|
|
@@ -5749,11 +5749,8 @@ async function generateInsightsWithAI(provider, modelId, systemPrompt, userPromp
|
|
|
5749
5749
|
maxRetries: 0,
|
|
5750
5750
|
output: Output5.object({ schema: engagementInsightsSchema }),
|
|
5751
5751
|
experimental_telemetry: { isEnabled: true },
|
|
5752
|
+
system: systemPrompt,
|
|
5752
5753
|
messages: [
|
|
5753
|
-
{
|
|
5754
|
-
role: "system",
|
|
5755
|
-
content: systemPrompt
|
|
5756
|
-
},
|
|
5757
5754
|
{
|
|
5758
5755
|
role: "user",
|
|
5759
5756
|
content: [
|
|
@@ -7015,11 +7012,8 @@ async function analyzeStoryboard2(imageDataUrl, provider, modelId, userPrompt, s
|
|
|
7015
7012
|
description: "Structured summary with title, description, and keywords.",
|
|
7016
7013
|
schema
|
|
7017
7014
|
}),
|
|
7015
|
+
system: systemPrompt,
|
|
7018
7016
|
messages: [
|
|
7019
|
-
{
|
|
7020
|
-
role: "system",
|
|
7021
|
-
content: systemPrompt
|
|
7022
|
-
},
|
|
7023
7017
|
{
|
|
7024
7018
|
role: "user",
|
|
7025
7019
|
content: [
|
|
@@ -7063,11 +7057,8 @@ async function analyzeAudioOnly(provider, modelId, userPrompt, systemPrompt, des
|
|
|
7063
7057
|
description: "Structured summary with title, description, and keywords.",
|
|
7064
7058
|
schema
|
|
7065
7059
|
}),
|
|
7060
|
+
system: systemPrompt,
|
|
7066
7061
|
messages: [
|
|
7067
|
-
{
|
|
7068
|
-
role: "system",
|
|
7069
|
-
content: systemPrompt
|
|
7070
|
-
},
|
|
7071
7062
|
{
|
|
7072
7063
|
role: "user",
|
|
7073
7064
|
content: userPrompt
|
|
@@ -8131,11 +8122,8 @@ async function translateVttWithAI({
|
|
|
8131
8122
|
model,
|
|
8132
8123
|
maxRetries: 0,
|
|
8133
8124
|
output: Output7.object({ schema: translationSchema }),
|
|
8125
|
+
system: SYSTEM_PROMPT6,
|
|
8134
8126
|
messages: [
|
|
8135
|
-
{
|
|
8136
|
-
role: "system",
|
|
8137
|
-
content: SYSTEM_PROMPT6
|
|
8138
|
-
},
|
|
8139
8127
|
{
|
|
8140
8128
|
role: "user",
|
|
8141
8129
|
content: `Translate from ${fromLanguageCode} to ${toLanguageCode}:${buildNeverTranslateSection(neverTranslate)}
|
|
@@ -8199,11 +8187,8 @@ async function translateCueChunkWithAI({
|
|
|
8199
8187
|
model,
|
|
8200
8188
|
maxRetries: 0,
|
|
8201
8189
|
output: Output7.object({ schema }),
|
|
8190
|
+
system: CUE_TRANSLATION_SYSTEM_PROMPT,
|
|
8202
8191
|
messages: [
|
|
8203
|
-
{
|
|
8204
|
-
role: "system",
|
|
8205
|
-
content: CUE_TRANSLATION_SYSTEM_PROMPT
|
|
8206
|
-
},
|
|
8207
8192
|
{
|
|
8208
8193
|
role: "user",
|
|
8209
8194
|
content: `Translate from ${fromLanguageCode} to ${toLanguageCode}.
|