@mux/ai 0.5.0 → 0.5.1
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-Dmo55n-5.d.ts → index-B5bQ-IQk.d.ts} +2 -0
- package/dist/{index-BdpEVCbj.d.ts → index-D4eU6RMH.d.ts} +2 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.js +14 -2
- package/dist/primitives/index.js.map +1 -1
- package/dist/workflows/index.d.ts +1 -1
- package/dist/workflows/index.js +16 -2
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { J as AudioTranslationOptions, I as AudioTranslationResult, e as BurnedInCaptionsAnalysis, c as BurnedInCaptionsOptions, b as BurnedInCaptionsPromptOverrides, a as BurnedInCaptionsPromptSections, B as BurnedInCaptionsResult, C as Chapter, o as ChapterSystemPromptSections, n as ChaptersOptions, m as ChaptersPromptOverrides, l as ChaptersPromptSections, k as ChaptersResult, j as ChaptersType, E as EmbeddingsOptions, q as EmbeddingsResult, u as HiveModerationOutput, H as HiveModerationSource, v as ModerationOptions, t as ModerationProvider, M as ModerationResult, S as SUMMARY_KEYWORD_LIMIT, F as SummarizationOptions, D as SummarizationPromptOverrides, A as SummarizationPromptSections, z as SummaryAndTagsResult, y as SummaryType, T as ThumbnailModerationScore, N as TranslationOptions, P as TranslationPayload, L as TranslationResult, d as burnedInCaptionsSchema, f as chapterSchema, g as chaptersSchema, p as generateChapters, r as generateEmbeddings, s as generateVideoEmbeddings, w as getModerationScores, G as getSummaryAndTags, h as hasBurnedInCaptions, x as summarySchema, K as translateAudio, Q as translateCaptions, O as translationSchema } from '../index-
|
|
1
|
+
export { J as AudioTranslationOptions, I as AudioTranslationResult, e as BurnedInCaptionsAnalysis, c as BurnedInCaptionsOptions, b as BurnedInCaptionsPromptOverrides, a as BurnedInCaptionsPromptSections, B as BurnedInCaptionsResult, C as Chapter, o as ChapterSystemPromptSections, n as ChaptersOptions, m as ChaptersPromptOverrides, l as ChaptersPromptSections, k as ChaptersResult, j as ChaptersType, E as EmbeddingsOptions, q as EmbeddingsResult, u as HiveModerationOutput, H as HiveModerationSource, v as ModerationOptions, t as ModerationProvider, M as ModerationResult, S as SUMMARY_KEYWORD_LIMIT, F as SummarizationOptions, D as SummarizationPromptOverrides, A as SummarizationPromptSections, z as SummaryAndTagsResult, y as SummaryType, T as ThumbnailModerationScore, N as TranslationOptions, P as TranslationPayload, L as TranslationResult, d as burnedInCaptionsSchema, f as chapterSchema, g as chaptersSchema, p as generateChapters, r as generateEmbeddings, s as generateVideoEmbeddings, w as getModerationScores, G as getSummaryAndTags, h as hasBurnedInCaptions, x as summarySchema, K as translateAudio, Q as translateCaptions, O as translationSchema } from '../index-D4eU6RMH.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import '@ai-sdk/anthropic';
|
|
4
4
|
import '@ai-sdk/google';
|
package/dist/workflows/index.js
CHANGED
|
@@ -29532,8 +29532,8 @@ async function generateVideoEmbeddings(assetId, options = {}) {
|
|
|
29532
29532
|
// src/primitives/thumbnails.ts
|
|
29533
29533
|
async function getThumbnailUrls(playbackId, duration, options = {}) {
|
|
29534
29534
|
"use step";
|
|
29535
|
-
const { interval = 10, width = 640, shouldSign = false, credentials } = options;
|
|
29536
|
-
|
|
29535
|
+
const { interval = 10, width = 640, shouldSign = false, maxSamples, credentials } = options;
|
|
29536
|
+
let timestamps = [];
|
|
29537
29537
|
if (duration <= 50) {
|
|
29538
29538
|
const spacing = duration / 6;
|
|
29539
29539
|
for (let i = 1; i <= 5; i++) {
|
|
@@ -29544,6 +29544,18 @@ async function getThumbnailUrls(playbackId, duration, options = {}) {
|
|
|
29544
29544
|
timestamps.push(time);
|
|
29545
29545
|
}
|
|
29546
29546
|
}
|
|
29547
|
+
if (maxSamples !== void 0 && timestamps.length > maxSamples) {
|
|
29548
|
+
const newTimestamps = [];
|
|
29549
|
+
newTimestamps.push(0);
|
|
29550
|
+
if (maxSamples >= 2) {
|
|
29551
|
+
const spacing = duration / (maxSamples - 1);
|
|
29552
|
+
for (let i = 1; i < maxSamples - 1; i++) {
|
|
29553
|
+
newTimestamps.push(spacing * i);
|
|
29554
|
+
}
|
|
29555
|
+
newTimestamps.push(duration);
|
|
29556
|
+
}
|
|
29557
|
+
timestamps = newTimestamps;
|
|
29558
|
+
}
|
|
29547
29559
|
const baseUrl = `https://image.mux.com/${playbackId}/thumbnail.png`;
|
|
29548
29560
|
const urlPromises = timestamps.map(async (time) => {
|
|
29549
29561
|
if (shouldSign) {
|
|
@@ -29809,6 +29821,7 @@ async function getModerationScores(assetId, options = {}) {
|
|
|
29809
29821
|
thresholds = DEFAULT_THRESHOLDS,
|
|
29810
29822
|
thumbnailInterval = 10,
|
|
29811
29823
|
thumbnailWidth = 640,
|
|
29824
|
+
maxSamples,
|
|
29812
29825
|
maxConcurrent = 5,
|
|
29813
29826
|
imageSubmissionMode = "url",
|
|
29814
29827
|
imageDownloadOptions,
|
|
@@ -29860,6 +29873,7 @@ async function getModerationScores(assetId, options = {}) {
|
|
|
29860
29873
|
interval: thumbnailInterval,
|
|
29861
29874
|
width: thumbnailWidth,
|
|
29862
29875
|
shouldSign: policy === "signed",
|
|
29876
|
+
maxSamples,
|
|
29863
29877
|
credentials
|
|
29864
29878
|
});
|
|
29865
29879
|
if (provider === "openai") {
|