@speakableio/core 1.0.61 → 1.0.62
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 +19 -6
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +19 -6
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +2 -2
- package/dist/index.web.js +19 -6
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.native.mjs
CHANGED
|
@@ -2314,19 +2314,32 @@ 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
|
+
if (model === "whisper-3") {
|
|
2323
|
+
try {
|
|
2324
|
+
const { data } = await (getWhisper3Transcript == null ? void 0 : getWhisper3Transcript({
|
|
2325
|
+
audioUrl: args.audioUrl,
|
|
2326
|
+
language: args.language
|
|
2327
|
+
}));
|
|
2328
|
+
return cleanHallucinations ? cleanHallucinatedTranscript(data) : data;
|
|
2329
|
+
} catch (error) {
|
|
2330
|
+
console.error("Error getting transcript from Whisper-3:", error);
|
|
2331
|
+
throw error;
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2321
2334
|
if (model === "whisper") {
|
|
2322
2335
|
try {
|
|
2323
|
-
const { data } = await (
|
|
2336
|
+
const { data } = await (getWhisper1Transcript == null ? void 0 : getWhisper1Transcript({
|
|
2324
2337
|
audioUrl: args.audioUrl,
|
|
2325
2338
|
language: args.language
|
|
2326
2339
|
}));
|
|
2327
2340
|
return cleanHallucinations ? cleanHallucinatedTranscript(data) : data;
|
|
2328
2341
|
} catch (error) {
|
|
2329
|
-
console.error("Error getting transcript from Whisper:", error);
|
|
2342
|
+
console.error("Error getting transcript from Whisper-1:", error);
|
|
2330
2343
|
throw error;
|
|
2331
2344
|
}
|
|
2332
2345
|
}
|
|
@@ -2335,7 +2348,7 @@ async function getTranscript(model, args, cleanHallucinations = true) {
|
|
|
2335
2348
|
const { data } = await (getGeminiTranscript == null ? void 0 : getGeminiTranscript({
|
|
2336
2349
|
audioUrl: args.audioUrl,
|
|
2337
2350
|
targetLanguage: args.language,
|
|
2338
|
-
prompt: (
|
|
2351
|
+
prompt: (_i = args.prompt) != null ? _i : ""
|
|
2339
2352
|
}));
|
|
2340
2353
|
return cleanHallucinations ? cleanHallucinatedTranscript(data.transcript) : data.transcript;
|
|
2341
2354
|
} catch (error) {
|
|
@@ -2358,7 +2371,7 @@ async function getTranscript(model, args, cleanHallucinations = true) {
|
|
|
2358
2371
|
return null;
|
|
2359
2372
|
}
|
|
2360
2373
|
async function getTranscriptCycle(args) {
|
|
2361
|
-
const models = ["whisper", "gemini", "assemblyai"];
|
|
2374
|
+
const models = ["whisper-3", "whisper", "gemini", "assemblyai"];
|
|
2362
2375
|
let transcript = "";
|
|
2363
2376
|
let lastError = null;
|
|
2364
2377
|
for (const model of models) {
|