@mux/ai 0.38.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 +13 -1
- 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 +12 -0
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH, j as ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH, k as
|
|
1
|
+
export { A as ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH, j as ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH, k as ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL, l as ASK_QUESTIONS_MAX_QUESTION_LENGTH, m as AskQuestionsOptions, n as AskQuestionsResult, o as AskQuestionsType, p as AudioTranslationOptions, q as AudioTranslationResult, r as AutoCensorProfanityOptions, B as BurnedInCaptionsAnalysis, s as BurnedInCaptionsOptions, u as BurnedInCaptionsPromptOverrides, v as BurnedInCaptionsPromptSections, w as BurnedInCaptionsResult, C as CaptionReplacement, x as CensorMode, y as Chapter, z as ChapterSystemPromptSections, D as ChaptersOptions, E as ChaptersPromptOverrides, F as ChaptersPromptSections, G as ChaptersResult, H as ChaptersType, J as DEFAULT_DESCRIPTION_LENGTH, K as DEFAULT_SUMMARY_KEYWORD_LIMIT, M as DEFAULT_TITLE_LENGTH, N as EditCaptionsOptions, O as EditCaptionsResult, P as EmbeddingsOptions, Q as EmbeddingsResult, R as EngagementInsightsOptions, T as EngagementInsightsResult, U as GOOGLE_VISION_LIKELIHOOD_TO_SCORE, V as HIVE_SEXUAL_CATEGORIES, W as HIVE_VIOLENCE_CATEGORIES, X as HiveModerationOutput, Y as HiveModerationSource, Z as ModerationOptions, _ as ModerationProvider, $ as ModerationResult, a0 as MomentInsight, a1 as OverallInsight, a2 as ProfanityDetectionPayload, a3 as Question, a4 as QuestionAnswer, a5 as QuestionAnswerType, a6 as ReplacementRecord, a7 as SpeakerReplacement, a8 as StaticRenditionCleanupOutcome, a9 as SummarizationOptions, aa as SummarizationPromptOverrides, ab as SummarizationPromptSections, ac as SummaryAndTagsResult, ad as SummaryType, ae as ThumbnailModerationScore, af as TranslationChunkingOptions, ag as TranslationOptions, ah as TranslationPayload, ai as TranslationResult, aj as aggregateTokenUsage, ak as applyOverrideLists, al as applyReplacements, am as applySpeakerReplacements, an as askQuestions, ao as buildReplacementRegex, ap as burnedInCaptionsSchema, aq as censorVttContent, ar as chapterSchema, as as chaptersSchema, at as createReplacer, au as editCaptions, av as extractTranscriptSegmentsForHotspots, aw as generateChapters, ax as generateEmbeddings, ay as generateEngagementInsights, az as generateVideoEmbeddings, aA as getModerationScores, aB as getSummaryAndTags, aC as hasBurnedInCaptions, aD as mapShotsToHotspots, aE as normalizeTranslatedVtt, aF as profanityDetectionSchema, aG as questionAnswerSchema, aH as shouldSplitChunkTranslationError, aI as summarySchema, aJ as transformCueText, aK as translateAudio, aL as translateCaptions, aM as translationSchema, aN as validateNeverTranslateTerms, aO as verifyNeverTranslateTerms } from '../index-Wjbq-_Z0.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@ai-sdk/anthropic';
|
|
4
4
|
import '@ai-sdk/google';
|
package/dist/workflows/index.js
CHANGED
|
@@ -41,6 +41,10 @@ var EnvSchema = z.object({
|
|
|
41
41
|
"Override for Mux stream base URL (defaults to https://stream.mux.com).",
|
|
42
42
|
"Mux stream URL override"
|
|
43
43
|
),
|
|
44
|
+
MUX_BASE_URL: optionalString(
|
|
45
|
+
"Override for the Mux API base URL (defaults to https://api.mux.com).",
|
|
46
|
+
"Mux API base URL override"
|
|
47
|
+
),
|
|
44
48
|
// The canary is substring-matched against every LLM output via
|
|
45
49
|
// `detectLeakReason` ("canary" reason). A too-short override (e.g. a
|
|
46
50
|
// 3-letter test value like "mux" or "the") would match legitimate
|
|
@@ -2521,6 +2525,7 @@ async function fetchTranscriptForAsset(asset, playbackId, options = {}) {
|
|
|
2521
2525
|
|
|
2522
2526
|
// src/workflows/ask-questions.ts
|
|
2523
2527
|
var ASK_QUESTIONS_MAX_QUESTION_LENGTH = 600;
|
|
2528
|
+
var ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL = 50;
|
|
2524
2529
|
var ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH = 150;
|
|
2525
2530
|
var ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH = 500;
|
|
2526
2531
|
var questionAnswerSchema = z3.object({
|
|
@@ -2983,6 +2988,12 @@ async function askQuestionsInternal(assetId, questions, options, collectedUsage)
|
|
|
2983
2988
|
if (!questions || questions.length === 0) {
|
|
2984
2989
|
throw new MuxAiError("At least one question must be provided.", { type: "validation_error" });
|
|
2985
2990
|
}
|
|
2991
|
+
if (questions.length > ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL) {
|
|
2992
|
+
throw new MuxAiError(
|
|
2993
|
+
`Too many questions: received ${questions.length}, but at most ${ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL} are allowed per call.`,
|
|
2994
|
+
{ type: "validation_error" }
|
|
2995
|
+
);
|
|
2996
|
+
}
|
|
2986
2997
|
questions.forEach((q, idx) => {
|
|
2987
2998
|
if (!q.question || typeof q.question !== "string" || !q.question.trim()) {
|
|
2988
2999
|
throw new MuxAiError(
|
|
@@ -8289,6 +8300,7 @@ async function translateCaptionsInternal(assetId, trackId, toLanguageCode, optio
|
|
|
8289
8300
|
export {
|
|
8290
8301
|
ASK_QUESTIONS_DEFAULT_MAX_ANSWER_OPTION_LENGTH,
|
|
8291
8302
|
ASK_QUESTIONS_DEFAULT_MAX_FREE_FORM_ANSWER_LENGTH,
|
|
8303
|
+
ASK_QUESTIONS_MAX_QUESTIONS_PER_CALL,
|
|
8292
8304
|
ASK_QUESTIONS_MAX_QUESTION_LENGTH,
|
|
8293
8305
|
DEFAULT_DESCRIPTION_LENGTH,
|
|
8294
8306
|
DEFAULT_SUMMARY_KEYWORD_LIMIT,
|