@speakableio/core 1.0.61 → 1.0.63
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.native.d.mts +2 -2
- package/dist/index.native.d.ts +2 -2
- package/dist/index.native.js +20 -6
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +20 -6
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +2 -2
- package/dist/index.web.js +20 -6
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.native.mjs
CHANGED
|
@@ -2314,19 +2314,33 @@ function cleanHallucinatedTranscript(transcript) {
|
|
|
2314
2314
|
|
|
2315
2315
|
// src/utils/ai/get-transcript.ts
|
|
2316
2316
|
async function getTranscript(model, args, cleanHallucinations = true) {
|
|
2317
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2317
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2318
2318
|
const getGeminiTranscript = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "getGeminiTranscript");
|
|
2319
2319
|
const getAssemblyAITranscript = (_d = (_c = api).httpsCallable) == null ? void 0 : _d.call(_c, "transcribeAssemblyAIAudio");
|
|
2320
|
-
const
|
|
2320
|
+
const getWhisper3Transcript = (_f = (_e = api).httpsCallable) == null ? void 0 : _f.call(_e, "generateGroqTranscript");
|
|
2321
|
+
const getWhisper1Transcript = (_h = (_g = api).httpsCallable) == null ? void 0 : _h.call(_g, "transcribeAudio");
|
|
2322
|
+
console.log("Getting transcript from", model);
|
|
2323
|
+
if (model === "whisper-3") {
|
|
2324
|
+
try {
|
|
2325
|
+
const { data } = await (getWhisper3Transcript == null ? void 0 : getWhisper3Transcript({
|
|
2326
|
+
audioUrl: args.audioUrl,
|
|
2327
|
+
language: args.language
|
|
2328
|
+
}));
|
|
2329
|
+
return cleanHallucinations ? cleanHallucinatedTranscript(data) : data;
|
|
2330
|
+
} catch (error) {
|
|
2331
|
+
console.error("Error getting transcript from Whisper-3:", error);
|
|
2332
|
+
throw error;
|
|
2333
|
+
}
|
|
2334
|
+
}
|
|
2321
2335
|
if (model === "whisper") {
|
|
2322
2336
|
try {
|
|
2323
|
-
const { data } = await (
|
|
2337
|
+
const { data } = await (getWhisper1Transcript == null ? void 0 : getWhisper1Transcript({
|
|
2324
2338
|
audioUrl: args.audioUrl,
|
|
2325
2339
|
language: args.language
|
|
2326
2340
|
}));
|
|
2327
2341
|
return cleanHallucinations ? cleanHallucinatedTranscript(data) : data;
|
|
2328
2342
|
} catch (error) {
|
|
2329
|
-
console.error("Error getting transcript from Whisper:", error);
|
|
2343
|
+
console.error("Error getting transcript from Whisper-1:", error);
|
|
2330
2344
|
throw error;
|
|
2331
2345
|
}
|
|
2332
2346
|
}
|
|
@@ -2335,7 +2349,7 @@ async function getTranscript(model, args, cleanHallucinations = true) {
|
|
|
2335
2349
|
const { data } = await (getGeminiTranscript == null ? void 0 : getGeminiTranscript({
|
|
2336
2350
|
audioUrl: args.audioUrl,
|
|
2337
2351
|
targetLanguage: args.language,
|
|
2338
|
-
prompt: (
|
|
2352
|
+
prompt: (_i = args.prompt) != null ? _i : ""
|
|
2339
2353
|
}));
|
|
2340
2354
|
return cleanHallucinations ? cleanHallucinatedTranscript(data.transcript) : data.transcript;
|
|
2341
2355
|
} catch (error) {
|
|
@@ -2358,7 +2372,7 @@ async function getTranscript(model, args, cleanHallucinations = true) {
|
|
|
2358
2372
|
return null;
|
|
2359
2373
|
}
|
|
2360
2374
|
async function getTranscriptCycle(args) {
|
|
2361
|
-
const models = ["whisper", "gemini", "assemblyai"];
|
|
2375
|
+
const models = ["whisper-3", "whisper", "gemini", "assemblyai"];
|
|
2362
2376
|
let transcript = "";
|
|
2363
2377
|
let lastError = null;
|
|
2364
2378
|
for (const model of models) {
|