@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.
@@ -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-BdpEVCbj.js';
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';
@@ -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
- const timestamps = [];
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") {