@steipete/summarize-core 0.11.1 → 0.13.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/esm/content/bun.js +21 -0
- package/dist/esm/content/bun.js.map +1 -0
- package/dist/esm/content/direct-media.js +100 -0
- package/dist/esm/content/direct-media.js.map +1 -0
- package/dist/esm/content/index.js +2 -1
- package/dist/esm/content/index.js.map +1 -1
- package/dist/esm/content/link-preview/client.js +6 -0
- package/dist/esm/content/link-preview/client.js.map +1 -1
- package/dist/esm/content/link-preview/content/fetcher.js +19 -2
- package/dist/esm/content/link-preview/content/fetcher.js.map +1 -1
- package/dist/esm/content/link-preview/content/firecrawl.js.map +1 -1
- package/dist/esm/content/link-preview/content/html.js.map +1 -1
- package/dist/esm/content/link-preview/content/index.js +29 -12
- package/dist/esm/content/link-preview/content/index.js.map +1 -1
- package/dist/esm/content/link-preview/content/utils.js.map +1 -1
- package/dist/esm/content/link-preview/content/video.js +1 -1
- package/dist/esm/content/link-preview/content/video.js.map +1 -1
- package/dist/esm/content/local-file.js +58 -0
- package/dist/esm/content/local-file.js.map +1 -0
- package/dist/esm/content/transcript/index.js +2 -0
- package/dist/esm/content/transcript/index.js.map +1 -1
- package/dist/esm/content/transcript/providers/generic-direct-media.js +47 -0
- package/dist/esm/content/transcript/providers/generic-direct-media.js.map +1 -0
- package/dist/esm/content/transcript/providers/generic-embedded.js +126 -0
- package/dist/esm/content/transcript/providers/generic-embedded.js.map +1 -0
- package/dist/esm/content/transcript/providers/generic-twitter.js +78 -0
- package/dist/esm/content/transcript/providers/generic-twitter.js.map +1 -0
- package/dist/esm/content/transcript/providers/generic.js +12 -248
- package/dist/esm/content/transcript/providers/generic.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/apple-flow.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/media.js +9 -1
- package/dist/esm/content/transcript/providers/podcast/media.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/provider-flow.js +157 -0
- package/dist/esm/content/transcript/providers/podcast/provider-flow.js.map +1 -0
- package/dist/esm/content/transcript/providers/podcast/rss-feed.js +123 -0
- package/dist/esm/content/transcript/providers/podcast/rss-feed.js.map +1 -0
- package/dist/esm/content/transcript/providers/podcast/rss-transcript.js +113 -0
- package/dist/esm/content/transcript/providers/podcast/rss-transcript.js.map +1 -0
- package/dist/esm/content/transcript/providers/podcast/rss.js +2 -226
- package/dist/esm/content/transcript/providers/podcast/rss.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast/spotify-flow.js.map +1 -1
- package/dist/esm/content/transcript/providers/podcast.js +26 -155
- package/dist/esm/content/transcript/providers/podcast.js.map +1 -1
- package/dist/esm/content/transcript/providers/transcription-capability.js +22 -0
- package/dist/esm/content/transcript/providers/transcription-capability.js.map +1 -0
- package/dist/esm/content/transcript/providers/transcription-start.js +43 -32
- package/dist/esm/content/transcript/providers/transcription-start.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/api.js +3 -2
- package/dist/esm/content/transcript/providers/youtube/api.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/captions-player.js +173 -0
- package/dist/esm/content/transcript/providers/youtube/captions-player.js.map +1 -0
- package/dist/esm/content/transcript/providers/youtube/captions-shared.js +8 -0
- package/dist/esm/content/transcript/providers/youtube/captions-shared.js.map +1 -0
- package/dist/esm/content/transcript/providers/youtube/captions-transcript.js +361 -0
- package/dist/esm/content/transcript/providers/youtube/captions-transcript.js.map +1 -0
- package/dist/esm/content/transcript/providers/youtube/captions.js +2 -557
- package/dist/esm/content/transcript/providers/youtube/captions.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube/provider-flow.js +217 -0
- package/dist/esm/content/transcript/providers/youtube/provider-flow.js.map +1 -0
- package/dist/esm/content/transcript/providers/youtube/yt-dlp.js +33 -9
- package/dist/esm/content/transcript/providers/youtube/yt-dlp.js.map +1 -1
- package/dist/esm/content/transcript/providers/youtube.js +42 -194
- package/dist/esm/content/transcript/providers/youtube.js.map +1 -1
- package/dist/esm/content/transcript/transcription-config.js +24 -4
- package/dist/esm/content/transcript/transcription-config.js.map +1 -1
- package/dist/esm/content/url.js +5 -33
- package/dist/esm/content/url.js.map +1 -1
- package/dist/esm/processes.js.map +1 -1
- package/dist/esm/prompts/format.js +6 -0
- package/dist/esm/prompts/format.js.map +1 -1
- package/dist/esm/prompts/link-summary.js +27 -3
- package/dist/esm/prompts/link-summary.js.map +1 -1
- package/dist/esm/transcription/onnx-cli.js.map +1 -1
- package/dist/esm/transcription/whisper/assemblyai.js +132 -0
- package/dist/esm/transcription/whisper/assemblyai.js.map +1 -0
- package/dist/esm/transcription/whisper/chunking.js +64 -0
- package/dist/esm/transcription/whisper/chunking.js.map +1 -0
- package/dist/esm/transcription/whisper/cloud-providers.js +69 -0
- package/dist/esm/transcription/whisper/cloud-providers.js.map +1 -0
- package/dist/esm/transcription/whisper/core.js +320 -390
- package/dist/esm/transcription/whisper/core.js.map +1 -1
- package/dist/esm/transcription/whisper/gemini.js +324 -0
- package/dist/esm/transcription/whisper/gemini.js.map +1 -0
- package/dist/esm/transcription/whisper/groq.js +62 -1
- package/dist/esm/transcription/whisper/groq.js.map +1 -1
- package/dist/esm/transcription/whisper/preferences.js +16 -0
- package/dist/esm/transcription/whisper/preferences.js.map +1 -0
- package/dist/esm/transcription/whisper/provider-setup.js +62 -0
- package/dist/esm/transcription/whisper/provider-setup.js.map +1 -0
- package/dist/esm/transcription/whisper/remote-provider-attempts.js +189 -0
- package/dist/esm/transcription/whisper/remote-provider-attempts.js.map +1 -0
- package/dist/esm/transcription/whisper/remote.js +220 -0
- package/dist/esm/transcription/whisper/remote.js.map +1 -0
- package/dist/esm/transcription/whisper/whisper-cpp.js +21 -18
- package/dist/esm/transcription/whisper/whisper-cpp.js.map +1 -1
- package/dist/types/content/bun.d.ts +6 -0
- package/dist/types/content/direct-media.d.ts +9 -0
- package/dist/types/content/index.d.ts +2 -1
- package/dist/types/content/link-preview/client.d.ts +3 -1
- package/dist/types/content/link-preview/content/fetcher.d.ts +1 -1
- package/dist/types/content/link-preview/content/html.d.ts +1 -1
- package/dist/types/content/link-preview/deps.d.ts +8 -2
- package/dist/types/content/link-preview/types.d.ts +1 -1
- package/dist/types/content/local-file.d.ts +16 -0
- package/dist/types/content/transcript/providers/generic-direct-media.d.ts +11 -0
- package/dist/types/content/transcript/providers/generic-embedded.d.ts +16 -0
- package/dist/types/content/transcript/providers/generic-twitter.d.ts +11 -0
- package/dist/types/content/transcript/providers/podcast/flow-context.d.ts +3 -0
- package/dist/types/content/transcript/providers/podcast/media.d.ts +4 -2
- package/dist/types/content/transcript/providers/podcast/provider-flow.d.ts +7 -0
- package/dist/types/content/transcript/providers/podcast/rss-feed.d.ts +15 -0
- package/dist/types/content/transcript/providers/podcast/rss-transcript.d.ts +12 -0
- package/dist/types/content/transcript/providers/podcast/rss.d.ts +2 -24
- package/dist/types/content/transcript/providers/transcription-capability.d.ts +18 -0
- package/dist/types/content/transcript/providers/transcription-start.d.ts +11 -3
- package/dist/types/content/transcript/providers/youtube/captions-player.d.ts +12 -0
- package/dist/types/content/transcript/providers/youtube/captions-shared.d.ts +42 -0
- package/dist/types/content/transcript/providers/youtube/captions-transcript.d.ts +4 -0
- package/dist/types/content/transcript/providers/youtube/captions.d.ts +2 -19
- package/dist/types/content/transcript/providers/youtube/provider-flow.d.ts +34 -0
- package/dist/types/content/transcript/providers/youtube/yt-dlp.d.ts +4 -2
- package/dist/types/content/transcript/transcription-config.d.ts +6 -0
- package/dist/types/content/transcript/types.d.ts +1 -0
- package/dist/types/content/url.d.ts +2 -3
- package/dist/types/prompts/format.d.ts +1 -0
- package/dist/types/prompts/link-summary.d.ts +2 -1
- package/dist/types/transcription/whisper/assemblyai.d.ts +17 -0
- package/dist/types/transcription/whisper/chunking.d.ts +11 -0
- package/dist/types/transcription/whisper/cloud-providers.d.ts +22 -0
- package/dist/types/transcription/whisper/core.d.ts +12 -14
- package/dist/types/transcription/whisper/gemini.d.ts +14 -0
- package/dist/types/transcription/whisper/preferences.d.ts +4 -0
- package/dist/types/transcription/whisper/provider-setup.d.ts +30 -0
- package/dist/types/transcription/whisper/remote-provider-attempts.d.ts +51 -0
- package/dist/types/transcription/whisper/remote.d.ts +51 -0
- package/dist/types/transcription/whisper/types.d.ts +1 -1
- package/dist/types/transcription/whisper/whisper-cpp.d.ts +4 -3
- package/package.json +14 -10
|
@@ -19,7 +19,8 @@ export declare const ProgressKind: {
|
|
|
19
19
|
readonly BirdStart: "bird-start";
|
|
20
20
|
readonly BirdDone: "bird-done";
|
|
21
21
|
};
|
|
22
|
-
export type
|
|
22
|
+
export type CloudTranscriptionProviderHint = "groq" | "assemblyai" | "gemini" | "openai" | "fal";
|
|
23
|
+
export type TranscriptionProviderHint = "cpp" | "onnx" | "unknown" | CloudTranscriptionProviderHint | `${CloudTranscriptionProviderHint}->${string}`;
|
|
23
24
|
/** Public progress events emitted by link preview fetchers. */
|
|
24
25
|
export type LinkPreviewProgressEvent = {
|
|
25
26
|
kind: "fetch-html-start";
|
|
@@ -104,9 +105,11 @@ export type LinkPreviewProgressEvent = {
|
|
|
104
105
|
} | {
|
|
105
106
|
kind: "bird-start";
|
|
106
107
|
url: string;
|
|
108
|
+
client?: "xurl" | "bird" | null;
|
|
107
109
|
} | {
|
|
108
110
|
kind: "bird-done";
|
|
109
111
|
url: string;
|
|
112
|
+
client?: "xurl" | "bird" | null;
|
|
110
113
|
ok: boolean;
|
|
111
114
|
textBytes: number | null;
|
|
112
115
|
};
|
|
@@ -130,7 +133,7 @@ export type BirdTweetMedia = {
|
|
|
130
133
|
kind: "video" | "audio";
|
|
131
134
|
urls: string[];
|
|
132
135
|
preferredUrl: string | null;
|
|
133
|
-
source: "extended_entities" | "card" | "entities";
|
|
136
|
+
source: "extended_entities" | "card" | "entities" | "xurl";
|
|
134
137
|
};
|
|
135
138
|
export type BirdTweetPayload = {
|
|
136
139
|
id?: string;
|
|
@@ -141,6 +144,7 @@ export type BirdTweetPayload = {
|
|
|
141
144
|
};
|
|
142
145
|
createdAt?: string;
|
|
143
146
|
media?: BirdTweetMedia | null;
|
|
147
|
+
client?: "xurl" | "bird";
|
|
144
148
|
};
|
|
145
149
|
export type ReadTweetWithBird = (args: {
|
|
146
150
|
url: string;
|
|
@@ -164,6 +168,8 @@ export interface LinkPreviewDeps {
|
|
|
164
168
|
transcription?: TranscriptionConfig | null;
|
|
165
169
|
falApiKey?: string | null;
|
|
166
170
|
groqApiKey?: string | null;
|
|
171
|
+
assemblyaiApiKey?: string | null;
|
|
172
|
+
geminiApiKey?: string | null;
|
|
167
173
|
openaiApiKey?: string | null;
|
|
168
174
|
convertHtmlToMarkdown: ConvertHtmlToMarkdown | null;
|
|
169
175
|
transcriptCache: TranscriptCache | null;
|
|
@@ -29,7 +29,7 @@ export interface MarkdownDiagnostics {
|
|
|
29
29
|
notes?: string | null;
|
|
30
30
|
}
|
|
31
31
|
export interface ContentFetchDiagnostics {
|
|
32
|
-
strategy: "bird" | "firecrawl" | "html" | "nitter";
|
|
32
|
+
strategy: "bird" | "xurl" | "firecrawl" | "html" | "nitter";
|
|
33
33
|
firecrawl: FirecrawlDiagnostics;
|
|
34
34
|
markdown: MarkdownDiagnostics;
|
|
35
35
|
transcript: TranscriptDiagnostics;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DirectMediaKind } from "./direct-media.js";
|
|
2
|
+
export type LocalFileReference = {
|
|
3
|
+
filePath: string;
|
|
4
|
+
fileUrl: string;
|
|
5
|
+
filename: string;
|
|
6
|
+
mtimeMs: number;
|
|
7
|
+
};
|
|
8
|
+
export type LocalDirectMediaSource = LocalFileReference & {
|
|
9
|
+
extension: string | null;
|
|
10
|
+
mediaKind: DirectMediaKind;
|
|
11
|
+
mediaType: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function isLocalFileUrl(value: string): boolean;
|
|
14
|
+
export declare function resolveLocalFileReference(value: string): LocalFileReference | null;
|
|
15
|
+
export declare function resolveLocalFileMtime(value: string): number | null;
|
|
16
|
+
export declare function resolveLocalDirectMediaSource(value: string, kindHint?: DirectMediaKind | null): LocalDirectMediaSource | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DirectMediaKind } from "../../direct-media.js";
|
|
2
|
+
import type { TranscriptionConfig } from "../transcription-config.js";
|
|
3
|
+
import type { ProviderFetchOptions, ProviderResult } from "../types.js";
|
|
4
|
+
export declare function fetchDirectMediaTranscript({ url, options, transcription, notes, attemptedProviders, kind, }: {
|
|
5
|
+
url: string;
|
|
6
|
+
options: ProviderFetchOptions;
|
|
7
|
+
transcription: TranscriptionConfig;
|
|
8
|
+
notes: string[];
|
|
9
|
+
attemptedProviders: ProviderResult["attemptedProviders"];
|
|
10
|
+
kind: DirectMediaKind | null;
|
|
11
|
+
}): Promise<ProviderResult | null>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TranscriptSegment } from "../../link-preview/types.js";
|
|
2
|
+
export type EmbeddedTrack = {
|
|
3
|
+
url: string;
|
|
4
|
+
type: string | null;
|
|
5
|
+
language: string | null;
|
|
6
|
+
};
|
|
7
|
+
export type EmbeddedMedia = {
|
|
8
|
+
kind: "video" | "audio";
|
|
9
|
+
mediaUrl: string | null;
|
|
10
|
+
track: EmbeddedTrack | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function detectEmbeddedMedia(html: string, baseUrl: string): EmbeddedMedia | null;
|
|
13
|
+
export declare function fetchCaptionTrack(fetchImpl: typeof fetch, track: EmbeddedTrack, notes: string[], includeSegments: boolean): Promise<{
|
|
14
|
+
text: string;
|
|
15
|
+
segments: TranscriptSegment[] | null;
|
|
16
|
+
} | null>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DirectMediaKind } from "../../direct-media.js";
|
|
2
|
+
import type { TranscriptionConfig } from "../transcription-config.js";
|
|
3
|
+
import type { ProviderContext, ProviderFetchOptions, ProviderResult } from "../types.js";
|
|
4
|
+
export declare function fetchTwitterMediaTranscript({ context, options, transcription, attemptedProviders, notes, mediaKindHint, }: {
|
|
5
|
+
context: ProviderContext;
|
|
6
|
+
options: ProviderFetchOptions;
|
|
7
|
+
transcription: TranscriptionConfig;
|
|
8
|
+
attemptedProviders: ProviderResult["attemptedProviders"];
|
|
9
|
+
notes: string[];
|
|
10
|
+
mediaKindHint: DirectMediaKind | null;
|
|
11
|
+
}): Promise<ProviderResult>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { TranscriptionConfig } from "../../transcription-config.js";
|
|
1
2
|
import type { ProviderContext, ProviderFetchOptions, ProviderResult } from "../../types.js";
|
|
2
3
|
import type { TranscribeRequest, TranscriptionResult } from "./media.js";
|
|
3
4
|
export type PodcastFlowContext = {
|
|
4
5
|
context: ProviderContext;
|
|
5
6
|
options: ProviderFetchOptions;
|
|
7
|
+
transcription: TranscriptionConfig;
|
|
8
|
+
feedHtml: string | null;
|
|
6
9
|
attemptedProviders: ProviderResult["attemptedProviders"];
|
|
7
10
|
notes: string[];
|
|
8
11
|
pushOnce: (provider: ProviderResult["attemptedProviders"][number]) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ProviderFetchOptions } from "../../types.js";
|
|
2
1
|
import { type TranscriptionConfig } from "../../transcription-config.js";
|
|
2
|
+
import type { ProviderFetchOptions } from "../../types.js";
|
|
3
3
|
export type TranscribeRequest = {
|
|
4
4
|
url: string;
|
|
5
5
|
filenameHint: string;
|
|
@@ -10,7 +10,7 @@ export type TranscriptionResult = {
|
|
|
10
10
|
provider: string | null;
|
|
11
11
|
error: Error | null;
|
|
12
12
|
};
|
|
13
|
-
export declare function transcribeMediaUrl({ fetchImpl, transcription, env, url, filenameHint, durationSecondsHint, groqApiKey, openaiApiKey, falApiKey, notes, progress, }: {
|
|
13
|
+
export declare function transcribeMediaUrl({ fetchImpl, transcription, env, url, filenameHint, durationSecondsHint, groqApiKey, assemblyaiApiKey, geminiApiKey, openaiApiKey, falApiKey, notes, progress, }: {
|
|
14
14
|
fetchImpl: typeof fetch;
|
|
15
15
|
transcription?: Partial<TranscriptionConfig> | null;
|
|
16
16
|
env?: Record<string, string | undefined>;
|
|
@@ -18,6 +18,8 @@ export declare function transcribeMediaUrl({ fetchImpl, transcription, env, url,
|
|
|
18
18
|
filenameHint: string;
|
|
19
19
|
durationSecondsHint: number | null;
|
|
20
20
|
groqApiKey?: string | null;
|
|
21
|
+
assemblyaiApiKey?: string | null;
|
|
22
|
+
geminiApiKey?: string | null;
|
|
21
23
|
openaiApiKey?: string | null;
|
|
22
24
|
falApiKey?: string | null;
|
|
23
25
|
notes: string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProviderResult } from "../../types.js";
|
|
2
|
+
import type { PodcastFlowContext } from "./flow-context.js";
|
|
3
|
+
export declare function tryPodcastTranscriptFromFeed(flow: PodcastFlowContext): Promise<ProviderResult | null>;
|
|
4
|
+
export declare function tryFeedEnclosureTranscript(flow: PodcastFlowContext): Promise<ProviderResult | null>;
|
|
5
|
+
export declare function tryOgAudioTranscript(flow: PodcastFlowContext): Promise<ProviderResult | null>;
|
|
6
|
+
export declare function tryPodcastYtDlpTranscript(flow: PodcastFlowContext): Promise<ProviderResult | null>;
|
|
7
|
+
export declare function buildNoTranscriptResult(flow: PodcastFlowContext): ProviderResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function looksLikeRssOrAtomFeed(xml: string): boolean;
|
|
2
|
+
export declare function extractEnclosureFromFeed(xml: string): {
|
|
3
|
+
enclosureUrl: string;
|
|
4
|
+
durationSeconds: number | null;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare function extractEnclosureForEpisode(feedXml: string, episodeTitle: string): {
|
|
7
|
+
enclosureUrl: string;
|
|
8
|
+
durationSeconds: number | null;
|
|
9
|
+
} | null;
|
|
10
|
+
export declare function extractItemDurationSeconds(itemXml: string): number | null;
|
|
11
|
+
export declare function decodeXmlEntities(value: string): string;
|
|
12
|
+
export declare function normalizeLooseTitle(value: string): string;
|
|
13
|
+
export declare function extractFeedItems(xml: string): string[];
|
|
14
|
+
export declare function extractItemTitle(itemXml: string): string | null;
|
|
15
|
+
export declare function extractEnclosureUrlFromItem(xml: string): string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TranscriptSegment } from "../../../link-preview/types.js";
|
|
2
|
+
export declare function tryFetchTranscriptFromFeedXml({ fetchImpl, feedXml, episodeTitle, notes, }: {
|
|
3
|
+
fetchImpl: typeof fetch;
|
|
4
|
+
feedXml: string;
|
|
5
|
+
episodeTitle: string | null;
|
|
6
|
+
notes: string[];
|
|
7
|
+
}): Promise<{
|
|
8
|
+
text: string;
|
|
9
|
+
transcriptUrl: string;
|
|
10
|
+
transcriptType: string | null;
|
|
11
|
+
segments: TranscriptSegment[] | null;
|
|
12
|
+
} | null>;
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare function extractEnclosureFromFeed(xml: string): {
|
|
4
|
-
enclosureUrl: string;
|
|
5
|
-
durationSeconds: number | null;
|
|
6
|
-
} | null;
|
|
7
|
-
export declare function extractEnclosureForEpisode(feedXml: string, episodeTitle: string): {
|
|
8
|
-
enclosureUrl: string;
|
|
9
|
-
durationSeconds: number | null;
|
|
10
|
-
} | null;
|
|
11
|
-
export declare function extractItemDurationSeconds(itemXml: string): number | null;
|
|
12
|
-
export declare function decodeXmlEntities(value: string): string;
|
|
13
|
-
export declare function normalizeLooseTitle(value: string): string;
|
|
14
|
-
export declare function tryFetchTranscriptFromFeedXml({ fetchImpl, feedXml, episodeTitle, notes, }: {
|
|
15
|
-
fetchImpl: typeof fetch;
|
|
16
|
-
feedXml: string;
|
|
17
|
-
episodeTitle: string | null;
|
|
18
|
-
notes: string[];
|
|
19
|
-
}): Promise<{
|
|
20
|
-
text: string;
|
|
21
|
-
transcriptUrl: string;
|
|
22
|
-
transcriptType: string | null;
|
|
23
|
-
segments: TranscriptSegment[] | null;
|
|
24
|
-
} | null>;
|
|
1
|
+
export { decodeXmlEntities, extractEnclosureForEpisode, extractEnclosureFromFeed, extractItemDurationSeconds, looksLikeRssOrAtomFeed, normalizeLooseTitle, } from "./rss-feed.js";
|
|
2
|
+
export { tryFetchTranscriptFromFeedXml } from "./rss-transcript.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TranscriptionConfig } from "../transcription-config.js";
|
|
2
|
+
import type { ProviderResult, TranscriptSource } from "../types.js";
|
|
3
|
+
import { type TranscriptionAvailability } from "./transcription-start.js";
|
|
4
|
+
export type TranscriptProviderCapabilities = {
|
|
5
|
+
availability: TranscriptionAvailability;
|
|
6
|
+
canTranscribe: boolean;
|
|
7
|
+
canRunYtDlp: boolean;
|
|
8
|
+
missingProviderNote: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function resolveTranscriptProviderCapabilities({ transcription, ytDlpPath, }: {
|
|
11
|
+
transcription: TranscriptionConfig;
|
|
12
|
+
ytDlpPath?: string | null;
|
|
13
|
+
}): Promise<TranscriptProviderCapabilities>;
|
|
14
|
+
export declare function buildMissingTranscriptionProviderResult(args: {
|
|
15
|
+
attemptedProviders: TranscriptSource[];
|
|
16
|
+
metadata: NonNullable<ProviderResult["metadata"]>;
|
|
17
|
+
notes?: string[] | null;
|
|
18
|
+
}): ProviderResult;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TranscriptionProviderHint } from "../../link-preview/deps.js";
|
|
2
1
|
import { resolvePreferredOnnxModel } from "../../../transcription/onnx-cli.js";
|
|
2
|
+
import type { TranscriptionProviderHint } from "../../link-preview/deps.js";
|
|
3
3
|
import { type TranscriptionConfig } from "../transcription-config.js";
|
|
4
4
|
type Env = Record<string, string | undefined>;
|
|
5
5
|
export type TranscriptionAvailability = {
|
|
@@ -7,21 +7,29 @@ export type TranscriptionAvailability = {
|
|
|
7
7
|
onnxReady: boolean;
|
|
8
8
|
hasLocalWhisper: boolean;
|
|
9
9
|
hasGroq: boolean;
|
|
10
|
+
hasAssemblyAi: boolean;
|
|
11
|
+
hasGemini: boolean;
|
|
10
12
|
hasOpenai: boolean;
|
|
11
13
|
hasFal: boolean;
|
|
12
14
|
hasAnyProvider: boolean;
|
|
15
|
+
geminiModelId: string;
|
|
16
|
+
effectiveEnv: Env;
|
|
13
17
|
};
|
|
14
|
-
export declare function resolveTranscriptionAvailability({ env, transcription, groqApiKey, openaiApiKey, falApiKey, }: {
|
|
18
|
+
export declare function resolveTranscriptionAvailability({ env, transcription, groqApiKey, assemblyaiApiKey, geminiApiKey, openaiApiKey, falApiKey, }: {
|
|
15
19
|
env?: Env;
|
|
16
20
|
transcription?: Partial<TranscriptionConfig> | null;
|
|
17
21
|
groqApiKey?: string | null;
|
|
22
|
+
assemblyaiApiKey?: string | null;
|
|
23
|
+
geminiApiKey?: string | null;
|
|
18
24
|
openaiApiKey?: string | null;
|
|
19
25
|
falApiKey?: string | null;
|
|
20
26
|
}): Promise<TranscriptionAvailability>;
|
|
21
|
-
export declare function resolveTranscriptionStartInfo({ env, transcription, groqApiKey, openaiApiKey, falApiKey, }: {
|
|
27
|
+
export declare function resolveTranscriptionStartInfo({ env, transcription, groqApiKey, assemblyaiApiKey, geminiApiKey, openaiApiKey, falApiKey, }: {
|
|
22
28
|
env?: Env;
|
|
23
29
|
transcription?: Partial<TranscriptionConfig> | null;
|
|
24
30
|
groqApiKey?: string | null;
|
|
31
|
+
assemblyaiApiKey?: string | null;
|
|
32
|
+
geminiApiKey?: string | null;
|
|
25
33
|
openaiApiKey?: string | null;
|
|
26
34
|
falApiKey?: string | null;
|
|
27
35
|
}): Promise<{
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare function extractInitialPlayerResponse(html: string): Record<string, unknown> | null;
|
|
2
|
+
export declare function extractDurationSecondsFromPlayerPayload(payload: Record<string, unknown>): number | null;
|
|
3
|
+
export declare function extractYoutubeDurationSeconds(html: string): number | null;
|
|
4
|
+
export declare function extractInnertubeApiKey(html: string): string | null;
|
|
5
|
+
export declare function fetchYoutubePlayerPayload(fetchImpl: typeof fetch, { html, videoId }: {
|
|
6
|
+
html: string;
|
|
7
|
+
videoId: string;
|
|
8
|
+
}): Promise<Record<string, unknown> | null>;
|
|
9
|
+
export declare function fetchYoutubeDurationSecondsViaPlayer(fetchImpl: typeof fetch, { html, videoId }: {
|
|
10
|
+
html: string;
|
|
11
|
+
videoId: string;
|
|
12
|
+
}): Promise<number | null>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TranscriptSegment } from "../../../link-preview/types.js";
|
|
2
|
+
export interface YoutubeTranscriptContext {
|
|
3
|
+
html: string;
|
|
4
|
+
originalUrl: string;
|
|
5
|
+
videoId: string;
|
|
6
|
+
}
|
|
7
|
+
export type TranscriptPayload = {
|
|
8
|
+
text: string;
|
|
9
|
+
segments: TranscriptSegment[] | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const REQUEST_HEADERS: Record<string, string>;
|
|
12
|
+
export declare const YT_INITIAL_PLAYER_RESPONSE_TOKEN = "ytInitialPlayerResponse";
|
|
13
|
+
export declare const INNERTUBE_API_KEY_REGEX: RegExp;
|
|
14
|
+
export declare const isObjectLike: (value: unknown) => value is Record<string, unknown>;
|
|
15
|
+
export type YoutubePlayerContext = Record<string, unknown> & {
|
|
16
|
+
client?: unknown;
|
|
17
|
+
};
|
|
18
|
+
export type CaptionsPayload = Record<string, unknown> & {
|
|
19
|
+
captions?: unknown;
|
|
20
|
+
playerCaptionsTracklistRenderer?: unknown;
|
|
21
|
+
};
|
|
22
|
+
export type CaptionListRenderer = Record<string, unknown> & {
|
|
23
|
+
captionTracks?: unknown;
|
|
24
|
+
automaticCaptions?: unknown;
|
|
25
|
+
};
|
|
26
|
+
export type CaptionTrackRecord = Record<string, unknown> & {
|
|
27
|
+
languageCode?: unknown;
|
|
28
|
+
kind?: unknown;
|
|
29
|
+
baseUrl?: unknown;
|
|
30
|
+
url?: unknown;
|
|
31
|
+
};
|
|
32
|
+
export type CaptionEventRecord = Record<string, unknown> & {
|
|
33
|
+
segs?: unknown;
|
|
34
|
+
tStartMs?: unknown;
|
|
35
|
+
dDurationMs?: unknown;
|
|
36
|
+
};
|
|
37
|
+
export type CaptionSegmentRecord = Record<string, unknown> & {
|
|
38
|
+
utf8?: unknown;
|
|
39
|
+
};
|
|
40
|
+
export type CaptionPayload = {
|
|
41
|
+
events?: unknown;
|
|
42
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TranscriptPayload, YoutubeTranscriptContext } from "./captions-shared.js";
|
|
2
|
+
export declare const fetchTranscriptFromCaptionTracks: (fetchImpl: typeof fetch, { html, originalUrl, videoId, skipAutoGenerated, }: YoutubeTranscriptContext & {
|
|
3
|
+
skipAutoGenerated?: boolean;
|
|
4
|
+
}) => Promise<TranscriptPayload | null>;
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
html: string;
|
|
4
|
-
originalUrl: string;
|
|
5
|
-
videoId: string;
|
|
6
|
-
}
|
|
7
|
-
type TranscriptPayload = {
|
|
8
|
-
text: string;
|
|
9
|
-
segments: TranscriptSegment[] | null;
|
|
10
|
-
};
|
|
11
|
-
export declare function extractYoutubeDurationSeconds(html: string): number | null;
|
|
12
|
-
export declare function fetchYoutubeDurationSecondsViaPlayer(fetchImpl: typeof fetch, { html, videoId }: {
|
|
13
|
-
html: string;
|
|
14
|
-
videoId: string;
|
|
15
|
-
}): Promise<number | null>;
|
|
16
|
-
export declare const fetchTranscriptFromCaptionTracks: (fetchImpl: typeof fetch, { html, originalUrl, videoId, skipAutoGenerated, }: YoutubeTranscriptContext & {
|
|
17
|
-
skipAutoGenerated?: boolean;
|
|
18
|
-
}) => Promise<TranscriptPayload | null>;
|
|
19
|
-
export {};
|
|
1
|
+
export { extractYoutubeDurationSeconds, fetchYoutubeDurationSecondsViaPlayer, } from "./captions-player.js";
|
|
2
|
+
export { fetchTranscriptFromCaptionTracks } from "./captions-transcript.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TranscriptionConfig } from "../../transcription-config.js";
|
|
2
|
+
import type { ProviderContext, ProviderFetchOptions, ProviderResult, TranscriptSource } from "../../types.js";
|
|
3
|
+
type DurationMetadata = {
|
|
4
|
+
durationSeconds: number;
|
|
5
|
+
} | null;
|
|
6
|
+
export type YouTubeProviderFlow = {
|
|
7
|
+
context: ProviderContext;
|
|
8
|
+
options: ProviderFetchOptions;
|
|
9
|
+
transcription: TranscriptionConfig;
|
|
10
|
+
htmlText: string;
|
|
11
|
+
attemptedProviders: TranscriptSource[];
|
|
12
|
+
notes: string[];
|
|
13
|
+
effectiveVideoId: string | null;
|
|
14
|
+
durationMetadata: DurationMetadata;
|
|
15
|
+
canRunYtDlp: boolean;
|
|
16
|
+
pushHint: (hint: string) => void;
|
|
17
|
+
};
|
|
18
|
+
export declare function loadYoutubeHtml(context: ProviderContext, options: ProviderFetchOptions): Promise<string | null>;
|
|
19
|
+
export declare function resolveEffectiveVideoId(context: ProviderContext): string | null;
|
|
20
|
+
export declare function resolveDurationMetadata(args: {
|
|
21
|
+
htmlText: string;
|
|
22
|
+
effectiveVideoId: string | null;
|
|
23
|
+
url: string;
|
|
24
|
+
options: ProviderFetchOptions;
|
|
25
|
+
}): Promise<DurationMetadata>;
|
|
26
|
+
export declare function tryApifyTranscript(flow: YouTubeProviderFlow, hint: string): Promise<ProviderResult | null>;
|
|
27
|
+
export declare function tryManualCaptionTranscript(flow: YouTubeProviderFlow): Promise<ProviderResult | null>;
|
|
28
|
+
export declare function tryWebTranscript(flow: YouTubeProviderFlow): Promise<ProviderResult | null>;
|
|
29
|
+
export declare function tryYtDlpTranscript(args: {
|
|
30
|
+
flow: YouTubeProviderFlow;
|
|
31
|
+
mode: ProviderFetchOptions["youtubeTranscriptMode"];
|
|
32
|
+
}): Promise<ProviderResult | null>;
|
|
33
|
+
export declare function buildUnavailableResult(flow: YouTubeProviderFlow): ProviderResult;
|
|
34
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { type TranscriptionProvider } from "../../../../transcription/whisper.js";
|
|
1
2
|
import type { MediaCache } from "../../../cache/types.js";
|
|
2
3
|
import type { LinkPreviewProgressEvent } from "../../../link-preview/deps.js";
|
|
3
|
-
import { type TranscriptionProvider } from "../../../../transcription/whisper.js";
|
|
4
4
|
import { type TranscriptionConfig } from "../../transcription-config.js";
|
|
5
5
|
type YtDlpTranscriptResult = {
|
|
6
6
|
text: string | null;
|
|
@@ -13,6 +13,8 @@ type YtDlpRequest = {
|
|
|
13
13
|
transcription?: Partial<TranscriptionConfig> | null;
|
|
14
14
|
env?: Record<string, string | undefined>;
|
|
15
15
|
groqApiKey?: string | null;
|
|
16
|
+
assemblyaiApiKey?: string | null;
|
|
17
|
+
geminiApiKey?: string | null;
|
|
16
18
|
openaiApiKey?: string | null;
|
|
17
19
|
falApiKey?: string | null;
|
|
18
20
|
url: string;
|
|
@@ -26,6 +28,6 @@ type YtDlpDurationRequest = {
|
|
|
26
28
|
ytDlpPath: string | null;
|
|
27
29
|
url: string;
|
|
28
30
|
};
|
|
29
|
-
export declare const fetchTranscriptWithYtDlp: ({ ytDlpPath, transcription, env, groqApiKey, openaiApiKey, falApiKey, url, onProgress, service, mediaKind, mediaCache, extraArgs, }: YtDlpRequest) => Promise<YtDlpTranscriptResult>;
|
|
31
|
+
export declare const fetchTranscriptWithYtDlp: ({ ytDlpPath, transcription, env, groqApiKey, assemblyaiApiKey, geminiApiKey, openaiApiKey, falApiKey, url, onProgress, service, mediaKind, mediaCache, extraArgs, }: YtDlpRequest) => Promise<YtDlpTranscriptResult>;
|
|
30
32
|
export declare const fetchDurationSecondsWithYtDlp: ({ ytDlpPath, url, }: YtDlpDurationRequest) => Promise<number | null>;
|
|
31
33
|
export {};
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
export type TranscriptionConfig = {
|
|
2
2
|
env?: Record<string, string | undefined>;
|
|
3
3
|
groqApiKey: string | null;
|
|
4
|
+
assemblyaiApiKey: string | null;
|
|
5
|
+
geminiApiKey: string | null;
|
|
4
6
|
openaiApiKey: string | null;
|
|
5
7
|
falApiKey: string | null;
|
|
8
|
+
geminiModel: string | null;
|
|
6
9
|
};
|
|
7
10
|
type TranscriptionConfigInput = {
|
|
8
11
|
env?: Record<string, string | undefined>;
|
|
9
12
|
transcription?: Partial<TranscriptionConfig> | null;
|
|
10
13
|
groqApiKey?: string | null;
|
|
14
|
+
assemblyaiApiKey?: string | null;
|
|
15
|
+
geminiApiKey?: string | null;
|
|
11
16
|
openaiApiKey?: string | null;
|
|
12
17
|
falApiKey?: string | null;
|
|
18
|
+
geminiModel?: string | null;
|
|
13
19
|
};
|
|
14
20
|
export declare function resolveTranscriptionConfig(input: TranscriptionConfigInput): TranscriptionConfig;
|
|
15
21
|
export {};
|
|
@@ -22,6 +22,7 @@ export interface ProviderFetchOptions {
|
|
|
22
22
|
transcription?: TranscriptionConfig;
|
|
23
23
|
falApiKey?: string | null;
|
|
24
24
|
groqApiKey?: string | null;
|
|
25
|
+
geminiApiKey?: string | null;
|
|
25
26
|
openaiApiKey?: string | null;
|
|
26
27
|
mediaCache?: MediaCache | null;
|
|
27
28
|
resolveTwitterCookies?: ResolveTwitterCookies | null;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { DIRECT_MEDIA_EXTENSIONS, inferDirectMediaKind, isDirectMediaExtension, isDirectMediaUrl, isDirectVideoInput } from "./direct-media.js";
|
|
1
2
|
import { isPodcastHost } from "./link-preview/content/podcast-utils.js";
|
|
2
3
|
import { isTwitterBroadcastUrl, isTwitterStatusUrl } from "./link-preview/content/twitter-utils.js";
|
|
3
4
|
export declare const isYouTubeUrl: (rawUrl: string) => boolean;
|
|
4
|
-
export declare const DIRECT_MEDIA_EXTENSIONS: readonly ["mp4", "mov", "m4v", "mkv", "webm", "mpeg", "mpg", "avi", "wmv", "flv", "mp3", "m4a", "wav", "flac", "aac", "ogg", "opus", "aiff", "wma"];
|
|
5
5
|
export declare function isYouTubeVideoUrl(rawUrl: string): boolean;
|
|
6
6
|
export declare function extractYouTubeVideoId(rawUrl: string): string | null;
|
|
7
|
-
export declare function isDirectMediaUrl(url: string): boolean;
|
|
8
|
-
export declare function isDirectMediaExtension(ext: string): boolean;
|
|
9
7
|
export declare function shouldPreferUrlMode(url: string): boolean;
|
|
10
8
|
export { isTwitterBroadcastUrl, isTwitterStatusUrl, isPodcastHost };
|
|
9
|
+
export { DIRECT_MEDIA_EXTENSIONS, inferDirectMediaKind, isDirectMediaExtension, isDirectMediaUrl, isDirectVideoInput, };
|
|
@@ -16,7 +16,7 @@ export type ShareContextEntry = {
|
|
|
16
16
|
replyCount?: number | null;
|
|
17
17
|
timestamp?: string | null;
|
|
18
18
|
};
|
|
19
|
-
export declare function buildLinkSummaryPrompt({ url, title, siteName, description, content, truncated, hasTranscript, hasTranscriptTimestamps, slides, outputLanguage, summaryLength, shares, promptOverride, lengthInstruction, languageInstruction, }: {
|
|
19
|
+
export declare function buildLinkSummaryPrompt({ url, title, siteName, description, content, truncated, hasTranscript, hasTranscriptTimestamps, timestampLimitInstruction, slides, outputLanguage, summaryLength, shares, promptOverride, lengthInstruction, languageInstruction, }: {
|
|
20
20
|
url: string;
|
|
21
21
|
title: string | null;
|
|
22
22
|
siteName: string | null;
|
|
@@ -25,6 +25,7 @@ export declare function buildLinkSummaryPrompt({ url, title, siteName, descripti
|
|
|
25
25
|
truncated: boolean;
|
|
26
26
|
hasTranscript: boolean;
|
|
27
27
|
hasTranscriptTimestamps?: boolean;
|
|
28
|
+
timestampLimitInstruction?: string | null;
|
|
28
29
|
slides?: {
|
|
29
30
|
count: number;
|
|
30
31
|
text: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const ASSEMBLYAI_DEFAULT_SPEECH_MODEL = "universal-2";
|
|
2
|
+
export declare const ASSEMBLYAI_DEFAULT_MODELS: readonly ["universal-2"];
|
|
3
|
+
export declare const ASSEMBLYAI_TRANSCRIPTION_MODEL_ID: "assemblyai/universal-2";
|
|
4
|
+
type AssemblyAiOptions = {
|
|
5
|
+
fetchImpl?: typeof fetch;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
pollIntervalMs?: number;
|
|
8
|
+
timeoutMs?: number;
|
|
9
|
+
mediaType?: string | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function transcribeWithAssemblyAi(bytes: Uint8Array, mediaType: string, apiKey: string, options?: AssemblyAiOptions): Promise<string | null>;
|
|
12
|
+
export declare function transcribeFileWithAssemblyAi({ filePath, mediaType, apiKey, fetchImpl, baseUrl, pollIntervalMs, timeoutMs, }: {
|
|
13
|
+
filePath: string;
|
|
14
|
+
mediaType: string;
|
|
15
|
+
apiKey: string;
|
|
16
|
+
} & Pick<AssemblyAiOptions, "fetchImpl" | "baseUrl" | "pollIntervalMs" | "timeoutMs">): Promise<string | null>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WhisperProgressEvent, WhisperTranscriptionResult } from "./types.js";
|
|
2
|
+
export declare function transcribeChunkedFile({ filePath, segmentSeconds, totalDurationSeconds, onProgress, transcribeSegment, }: {
|
|
3
|
+
filePath: string;
|
|
4
|
+
segmentSeconds: number;
|
|
5
|
+
totalDurationSeconds: number | null;
|
|
6
|
+
onProgress?: ((event: WhisperProgressEvent) => void) | null;
|
|
7
|
+
transcribeSegment: (args: {
|
|
8
|
+
bytes: Uint8Array;
|
|
9
|
+
filename: string;
|
|
10
|
+
}) => Promise<WhisperTranscriptionResult>;
|
|
11
|
+
}): Promise<WhisperTranscriptionResult>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type CloudProvider = "assemblyai" | "gemini" | "openai" | "fal";
|
|
2
|
+
type CloudProviderKeyState = {
|
|
3
|
+
assemblyaiApiKey: string | null;
|
|
4
|
+
geminiApiKey: string | null;
|
|
5
|
+
openaiApiKey: string | null;
|
|
6
|
+
falApiKey: string | null;
|
|
7
|
+
};
|
|
8
|
+
type CloudProviderAvailability = {
|
|
9
|
+
hasAssemblyAi: boolean;
|
|
10
|
+
hasGemini: boolean;
|
|
11
|
+
hasOpenai: boolean;
|
|
12
|
+
hasFal: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function resolveCloudProviderOrder(state: CloudProviderKeyState): CloudProvider[];
|
|
15
|
+
export declare function cloudProviderLabel(provider: CloudProvider, chained: boolean): string;
|
|
16
|
+
export declare function formatCloudFallbackTargets(providers: CloudProvider[]): string;
|
|
17
|
+
export declare function buildCloudProviderHint(availability: CloudProviderAvailability): string | null;
|
|
18
|
+
export declare function buildCloudModelIdChain({ availability, geminiModelId, }: {
|
|
19
|
+
availability: CloudProviderAvailability;
|
|
20
|
+
geminiModelId: string;
|
|
21
|
+
}): string | null;
|
|
22
|
+
export {};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import type { WhisperProgressEvent, WhisperTranscriptionResult } from "./types.js";
|
|
2
2
|
type Env = Record<string, string | undefined>;
|
|
3
|
-
|
|
4
|
-
bytes: Uint8Array;
|
|
5
|
-
mediaType: string;
|
|
6
|
-
filename: string | null;
|
|
3
|
+
type MediaRequest = {
|
|
7
4
|
groqApiKey: string | null;
|
|
8
|
-
|
|
5
|
+
assemblyaiApiKey?: string | null;
|
|
6
|
+
geminiApiKey?: string | null;
|
|
9
7
|
openaiApiKey: string | null;
|
|
10
8
|
falApiKey: string | null;
|
|
11
9
|
totalDurationSeconds?: number | null;
|
|
12
10
|
onProgress?: ((event: WhisperProgressEvent) => void) | null;
|
|
13
11
|
env?: Env;
|
|
14
|
-
}
|
|
15
|
-
export declare function
|
|
12
|
+
};
|
|
13
|
+
export declare function transcribeMediaWithWhisper({ bytes, mediaType, filename, groqApiKey, skipGroq, assemblyaiApiKey, geminiApiKey, openaiApiKey, falApiKey, totalDurationSeconds, onProgress, env, }: {
|
|
14
|
+
bytes: Uint8Array;
|
|
15
|
+
mediaType: string;
|
|
16
|
+
filename: string | null;
|
|
17
|
+
skipGroq?: boolean;
|
|
18
|
+
} & MediaRequest): Promise<WhisperTranscriptionResult>;
|
|
19
|
+
export declare function transcribeMediaFileWithWhisper({ filePath, mediaType, filename, groqApiKey, assemblyaiApiKey, geminiApiKey, openaiApiKey, falApiKey, segmentSeconds, totalDurationSeconds, onProgress, env, }: {
|
|
16
20
|
filePath: string;
|
|
17
21
|
mediaType: string;
|
|
18
22
|
filename: string | null;
|
|
19
|
-
groqApiKey: string | null;
|
|
20
|
-
openaiApiKey: string | null;
|
|
21
|
-
falApiKey: string | null;
|
|
22
23
|
segmentSeconds?: number;
|
|
23
|
-
|
|
24
|
-
onProgress?: ((event: WhisperProgressEvent) => void) | null;
|
|
25
|
-
env?: Env;
|
|
26
|
-
}): Promise<WhisperTranscriptionResult>;
|
|
24
|
+
} & MediaRequest): Promise<WhisperTranscriptionResult>;
|
|
27
25
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Env = Record<string, string | undefined>;
|
|
2
|
+
export declare function transcribeWithGemini(bytes: Uint8Array, mediaType: string, filename: string | null, apiKey: string, options?: {
|
|
3
|
+
env?: Env;
|
|
4
|
+
model?: string | null;
|
|
5
|
+
}): Promise<string | null>;
|
|
6
|
+
export declare function transcribeFileWithGemini({ filePath, mediaType, filename, apiKey, env, model, }: {
|
|
7
|
+
filePath: string;
|
|
8
|
+
mediaType: string;
|
|
9
|
+
filename: string | null;
|
|
10
|
+
apiKey: string;
|
|
11
|
+
env?: Env;
|
|
12
|
+
model?: string | null;
|
|
13
|
+
}): Promise<string | null>;
|
|
14
|
+
export {};
|