@mux/ai 0.4.2 → 0.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mux/ai",
3
3
  "type": "module",
4
- "version": "0.4.2",
4
+ "version": "0.5.0",
5
5
  "description": "AI library for Mux",
6
6
  "author": "Mux",
7
7
  "license": "Apache-2.0",
@@ -84,6 +84,7 @@
84
84
  "example:burned-in": "npx tsx examples/burned-in-captions/basic-example.ts",
85
85
  "example:burned-in:compare": "npx tsx examples/burned-in-captions/provider-comparison.ts",
86
86
  "example:summarization": "npx tsx examples/summarization/basic-example.ts",
87
+ "example:summarization:audio-only": "npx tsx examples/summarization/audio-only-example.ts",
87
88
  "example:summarization:compare": "npx tsx examples/summarization/provider-comparison.ts",
88
89
  "example:signed-playback": "npx tsx examples/signed-playback/signed-playback.ts",
89
90
  "example:signed-playback:summarization": "npx tsx examples/signed-playback/signed-summarization.ts",
@@ -92,6 +93,8 @@
92
93
  "example:embeddings": "npx tsx examples/embeddings/basic-example.ts",
93
94
  "example:translate-captions": "npx tsx examples/translate-captions/basic-example.ts",
94
95
  "example:translate-audio": "npx tsx examples/translate-audio/basic-example.ts",
96
+ "evalite:post-results:dev": "npx tsx scripts/export-evalite-results.ts && npx tsx scripts/post-evalite-results.ts -d -k",
97
+ "evalite:post-results:production": "npx tsx scripts/export-evalite-results.ts && npx tsx scripts/post-evalite-results.ts",
95
98
  "prepare": "husky"
96
99
  },
97
100
  "dependencies": {
@@ -1,115 +0,0 @@
1
- import Mux from '@mux/mux-node';
2
-
3
- /**
4
- * Base options mixed into every higher-level workflow configuration.
5
- */
6
- interface MuxAIOptions {
7
- /** Optional timeout (ms) for helper utilities that support request limits. */
8
- timeout?: number;
9
- /**
10
- * Optional cancellation signal passed through to underlying AI SDK calls.
11
- * When aborted, in-flight model requests will be
12
- * cancelled where supported.
13
- */
14
- abortSignal?: AbortSignal;
15
- }
16
- /** Tone controls for the summarization helper. */
17
- type ToneType = "neutral" | "playful" | "professional";
18
- /** Common transport for image-based workflows. */
19
- type ImageSubmissionMode = "url" | "base64";
20
- /** Result of calling mux-node's asset retrieval helper. */
21
- type MuxAsset = Awaited<ReturnType<Mux["video"]["assets"]["retrieve"]>>;
22
- /** Single ready track extracted from a Mux asset. */
23
- type AssetTextTrack = NonNullable<MuxAsset["tracks"]>[number];
24
- /** Playback policy type for Mux assets. */
25
- type PlaybackPolicy = "public" | "signed";
26
- /** Convenience bundle returned by `getPlaybackIdForAsset`. */
27
- interface PlaybackAsset {
28
- asset: MuxAsset;
29
- playbackId: string;
30
- /** The policy type of the playback ID ('public' or 'signed'). */
31
- policy: PlaybackPolicy;
32
- }
33
- /** Configuration for token-based chunking. */
34
- interface TokenChunkingConfig {
35
- type: "token";
36
- /** Maximum tokens per chunk. */
37
- maxTokens: number;
38
- /** Number of overlapping tokens between chunks. */
39
- overlap?: number;
40
- }
41
- /** Configuration for VTT-aware chunking that respects cue boundaries. */
42
- interface VTTChunkingConfig {
43
- type: "vtt";
44
- /** Maximum tokens per chunk. */
45
- maxTokens: number;
46
- /** Number of cues to overlap between chunks (default: 2). */
47
- overlapCues?: number;
48
- }
49
- /** Union type for all chunking strategy configurations. */
50
- type ChunkingStrategy = TokenChunkingConfig | VTTChunkingConfig;
51
- /** A single chunk of text extracted from a transcript. */
52
- interface TextChunk {
53
- /** Unique identifier for this chunk. */
54
- id: string;
55
- /** The text content of the chunk. */
56
- text: string;
57
- /** Number of tokens in this chunk. */
58
- tokenCount: number;
59
- /** Start time in seconds (if available from timestamped transcript). */
60
- startTime?: number;
61
- /** End time in seconds (if available from timestamped transcript). */
62
- endTime?: number;
63
- }
64
- /** A chunk with its embedding vector. */
65
- interface ChunkEmbedding {
66
- /** Reference to the chunk ID. */
67
- chunkId: string;
68
- /** The embedding vector. */
69
- embedding: number[];
70
- /** Optional metadata for this chunk. */
71
- metadata: {
72
- startTime?: number;
73
- endTime?: number;
74
- tokenCount: number;
75
- };
76
- }
77
- /** Result of generating embeddings for a video asset. */
78
- interface VideoEmbeddingsResult {
79
- /** The Mux asset ID. */
80
- assetId: string;
81
- /** Individual chunk embeddings. */
82
- chunks: ChunkEmbedding[];
83
- /** Averaged embedding across all chunks. */
84
- averagedEmbedding: number[];
85
- /** AI provider used. */
86
- provider: string;
87
- /** Model used for embedding generation. */
88
- model: string;
89
- /** Additional metadata about the generation. */
90
- metadata: {
91
- totalChunks: number;
92
- totalTokens: number;
93
- chunkingStrategy: string;
94
- embeddingDimensions: number;
95
- generatedAt: string;
96
- };
97
- }
98
- /**
99
- * Token usage breakdown returned by AI SDK providers.
100
- * Used for efficiency and cost analysis.
101
- */
102
- interface TokenUsage {
103
- /** Number of tokens in the input prompt (text + image). */
104
- inputTokens?: number;
105
- /** Number of tokens generated in the output. */
106
- outputTokens?: number;
107
- /** Total tokens consumed (input + output). */
108
- totalTokens?: number;
109
- /** Tokens used for chain-of-thought reasoning (if applicable). */
110
- reasoningTokens?: number;
111
- /** Input tokens served from cache (reduces cost). */
112
- cachedInputTokens?: number;
113
- }
114
-
115
- export type { AssetTextTrack as A, ChunkingStrategy as C, ImageSubmissionMode as I, MuxAIOptions as M, PlaybackPolicy as P, ToneType as T, VTTChunkingConfig as V, MuxAsset as a, PlaybackAsset as b, TokenChunkingConfig as c, TextChunk as d, ChunkEmbedding as e, VideoEmbeddingsResult as f, TokenUsage as g };