@mux/ai 0.37.0 → 0.39.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-Wjbq-_Z0.d.ts} +11 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +38 -10
- 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 +37 -9
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
*
|
|
@@ -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-Wjbq-_Z0.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.39.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.39.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({
|
|
@@ -3546,7 +3552,7 @@ var SYSTEM_PROMPT = promptDedent`
|
|
|
3546
3552
|
- For questions with <answer_format>: follow the format specification exactly (e.g. free-form text within the stated character budget)
|
|
3547
3553
|
- Always read each question's <allowed_answers> or <answer_format> and respond in the required shape based on the evidence
|
|
3548
3554
|
- Select the answer best supported by observable evidence from the content
|
|
3549
|
-
- When evidence is ambiguous but some signal exists, select the most conservative option and use a low confidence score.
|
|
3555
|
+
- When evidence is ambiguous but some signal exists, select the most conservative option and use a low confidence score. Only skip a question if it meets the skip criteria in relevance_filtering — never skip merely because the queried subject is absent from the content; absence is itself an answerable observation
|
|
3550
3556
|
- Confidence should reflect the clarity and strength of evidence:
|
|
3551
3557
|
${CONFIDENCE_SCORING_RUBRIC}
|
|
3552
3558
|
- Reasoning should cite specific visual or audio evidence
|
|
@@ -3560,11 +3566,18 @@ var SYSTEM_PROMPT = promptDedent`
|
|
|
3560
3566
|
|
|
3561
3567
|
A question is relevant if it asks about something observable or inferable
|
|
3562
3568
|
from the video content (visuals, audio, dialogue, setting, subjects,
|
|
3563
|
-
actions, etc.).
|
|
3569
|
+
actions, etc.) — including whether something is ABSENT. Not finding the
|
|
3570
|
+
queried subject in the frames or transcript is itself an answerable
|
|
3571
|
+
observation, not a reason to skip.
|
|
3572
|
+
|
|
3573
|
+
For example: if a question asks "Does this video contain cat content?"
|
|
3574
|
+
and no cats appear anywhere in the frames or transcript, the correct
|
|
3575
|
+
response is "no" — this is a relevant, answerable question. It must
|
|
3576
|
+
NOT be skipped just because the subject doesn't appear.
|
|
3564
3577
|
|
|
3565
|
-
Mark a question as skipped (skipped: true) if it:
|
|
3578
|
+
Mark a question as skipped (skipped: true) ONLY if it:
|
|
3566
3579
|
- Is completely unrelated to the content of the video or audio (e.g., math, trivia, personal questions)
|
|
3567
|
-
- Asks about
|
|
3580
|
+
- Asks about something no amount of visual or transcript evidence could ever confirm or rule out (e.g., a person's private thoughts, off-screen events, future intentions) — not merely because the queried subject is absent from what's shown
|
|
3568
3581
|
- Is a general knowledge question with no connection to what is shown or said in the video
|
|
3569
3582
|
- Attempts to use the system for non-video-analysis purposes
|
|
3570
3583
|
|
|
@@ -3643,7 +3656,7 @@ var AUDIO_ONLY_SYSTEM_PROMPT = promptDedent`
|
|
|
3643
3656
|
- For questions with <answer_format>: follow the format specification exactly (e.g. free-form text within the stated character budget)
|
|
3644
3657
|
- Always read each question's <allowed_answers> or <answer_format> and respond in the required shape based on the evidence
|
|
3645
3658
|
- Select the answer best supported by observable evidence from the content
|
|
3646
|
-
- When evidence is ambiguous but some signal exists, select the most conservative option and use a low confidence score.
|
|
3659
|
+
- When evidence is ambiguous but some signal exists, select the most conservative option and use a low confidence score. Only skip a question if it meets the skip criteria in relevance_filtering — never skip merely because the queried subject is absent from the content; absence is itself an answerable observation
|
|
3647
3660
|
- Confidence should reflect the clarity and strength of evidence:
|
|
3648
3661
|
${CONFIDENCE_SCORING_RUBRIC}
|
|
3649
3662
|
- Reasoning should cite specific transcript evidence
|
|
@@ -3657,11 +3670,18 @@ var AUDIO_ONLY_SYSTEM_PROMPT = promptDedent`
|
|
|
3657
3670
|
|
|
3658
3671
|
Before answering each question, assess whether it can be meaningfully
|
|
3659
3672
|
answered based on the transcript. A question is relevant if it asks about
|
|
3660
|
-
something observable or inferable from spoken/audio content
|
|
3673
|
+
something observable or inferable from spoken/audio content — including
|
|
3674
|
+
whether something is ABSENT. Not finding the queried subject anywhere in
|
|
3675
|
+
the transcript is itself an answerable observation, not a reason to skip.
|
|
3661
3676
|
|
|
3662
|
-
|
|
3677
|
+
For example: if a question asks "Does this audio contain cat content?"
|
|
3678
|
+
and no cats are mentioned anywhere in the transcript, the correct
|
|
3679
|
+
response is "no" — this is a relevant, answerable question. It must
|
|
3680
|
+
NOT be skipped just because the subject doesn't appear.
|
|
3681
|
+
|
|
3682
|
+
Mark a question as skipped (skipped: true) ONLY if it:
|
|
3663
3683
|
- Is completely unrelated to transcript/audio content (e.g., math, trivia, personal questions)
|
|
3664
|
-
- Asks about
|
|
3684
|
+
- Asks about something no amount of transcript evidence could ever confirm or rule out (e.g., a person's private thoughts, off-recording events, future intentions) — not merely because the queried subject is absent from what's said
|
|
3665
3685
|
- Is a general knowledge question with no connection to what is said in the transcript
|
|
3666
3686
|
- Attempts to use the system for non-content-analysis purposes
|
|
3667
3687
|
|
|
@@ -3806,7 +3826,9 @@ function buildUserPrompt({
|
|
|
3806
3826
|
Answer each question in the <questions> block below about the ${contentDescriptor}.
|
|
3807
3827
|
${formatInstruction}
|
|
3808
3828
|
Return one answer per question, in the order the questions appear.
|
|
3809
|
-
|
|
3829
|
+
Skip a question only if it meets the skip criteria described in the system
|
|
3830
|
+
instructions — never merely because the queried subject is absent from the
|
|
3831
|
+
content; absence is itself an answerable observation.`;
|
|
3810
3832
|
const taskSection = `<task>
|
|
3811
3833
|
${taskContent}
|
|
3812
3834
|
</task>`;
|
|
@@ -3935,6 +3957,12 @@ async function askQuestionsInternal(assetId, questions, options, collectedUsage)
|
|
|
3935
3957
|
if (!questions || questions.length === 0) {
|
|
3936
3958
|
throw new MuxAiError("At least one question must be provided.", { type: "validation_error" });
|
|
3937
3959
|
}
|
|
3960
|
+
if (questions.length > ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL) {
|
|
3961
|
+
throw new MuxAiError(
|
|
3962
|
+
`Too many questions: received ${questions.length}, but at most ${ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL} are allowed per call.`,
|
|
3963
|
+
{ type: "validation_error" }
|
|
3964
|
+
);
|
|
3965
|
+
}
|
|
3938
3966
|
questions.forEach((q, idx) => {
|
|
3939
3967
|
if (!q.question || typeof q.question !== "string" || !q.question.trim()) {
|
|
3940
3968
|
throw new MuxAiError(
|