@speakableio/core 1.0.23 → 1.0.25
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 +28 -2
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +28 -2
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +2 -2
- package/dist/index.web.js +28 -2
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.web.d.mts
CHANGED
|
@@ -1520,7 +1520,7 @@ declare function SpeakableProvider({ user, children, queryClient, permissions, f
|
|
|
1520
1520
|
}): react_jsx_runtime.JSX.Element | null;
|
|
1521
1521
|
declare function useSpeakableApi(): FsContext;
|
|
1522
1522
|
|
|
1523
|
-
declare function getTranscript(model: 'gemini' | 'assemblyai', args: {
|
|
1523
|
+
declare function getTranscript(model: 'gemini' | 'assemblyai' | 'whisper', args: {
|
|
1524
1524
|
language: string;
|
|
1525
1525
|
audioUrl: string;
|
|
1526
1526
|
prompt?: string;
|
|
@@ -2763,7 +2763,7 @@ declare const useOrganizationAccess: () => {
|
|
|
2763
2763
|
|
|
2764
2764
|
declare function useSpeakableTranscript(): {
|
|
2765
2765
|
mutation: _tanstack_react_query.UseMutationResult<string | null, Error, {
|
|
2766
|
-
model: "gemini" | "assemblyai";
|
|
2766
|
+
model: "gemini" | "assemblyai" | "whisper";
|
|
2767
2767
|
audioUrl: string;
|
|
2768
2768
|
language: string;
|
|
2769
2769
|
prompt?: string;
|
package/dist/index.web.js
CHANGED
|
@@ -2136,9 +2136,22 @@ var createSetRepo = () => {
|
|
|
2136
2136
|
|
|
2137
2137
|
// src/utils/ai/get-transcript.ts
|
|
2138
2138
|
async function getTranscript(model, args) {
|
|
2139
|
-
var _a, _b, _c, _d;
|
|
2139
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2140
2140
|
const getGeminiTranscript = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "getGeminiTranscript");
|
|
2141
2141
|
const getAssemblyAITranscript = (_d = (_c = api).httpsCallable) == null ? void 0 : _d.call(_c, "transcribeAssemblyAIAudio");
|
|
2142
|
+
const getWhisperTranscript = (_f = (_e = api).httpsCallable) == null ? void 0 : _f.call(_e, "transcribeAudio");
|
|
2143
|
+
if (model === "whisper") {
|
|
2144
|
+
try {
|
|
2145
|
+
const { data } = await (getWhisperTranscript == null ? void 0 : getWhisperTranscript({
|
|
2146
|
+
audioUrl: args.audioUrl,
|
|
2147
|
+
language: args.language
|
|
2148
|
+
}));
|
|
2149
|
+
return data;
|
|
2150
|
+
} catch (error) {
|
|
2151
|
+
console.error("Error getting transcript from Whisper:", error);
|
|
2152
|
+
throw error;
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2142
2155
|
if (model === "gemini") {
|
|
2143
2156
|
try {
|
|
2144
2157
|
const { data } = await (getGeminiTranscript == null ? void 0 : getGeminiTranscript({
|
|
@@ -3120,9 +3133,22 @@ var useBaseOpenAI = ({
|
|
|
3120
3133
|
aiEnabled
|
|
3121
3134
|
});
|
|
3122
3135
|
const getTranscript2 = async (audioUrl, language, prompt) => {
|
|
3123
|
-
var _a, _b, _c, _d;
|
|
3136
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3124
3137
|
const getGeminiTranscript = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "getGeminiTranscript");
|
|
3125
3138
|
const getAssemblyAITranscript = (_d = (_c = api).httpsCallable) == null ? void 0 : _d.call(_c, "transcribeAssemblyAIAudio");
|
|
3139
|
+
const getWhisperTranscript = (_f = (_e = api).httpsCallable) == null ? void 0 : _f.call(_e, "transcribeAudio");
|
|
3140
|
+
try {
|
|
3141
|
+
const { data } = await (getWhisperTranscript == null ? void 0 : getWhisperTranscript({
|
|
3142
|
+
audioUrl,
|
|
3143
|
+
language
|
|
3144
|
+
}));
|
|
3145
|
+
const transcript = data;
|
|
3146
|
+
if (transcript) {
|
|
3147
|
+
return transcript;
|
|
3148
|
+
}
|
|
3149
|
+
} catch (error) {
|
|
3150
|
+
console.log("Whisper transcript failed, trying Gemini fallback:", error);
|
|
3151
|
+
}
|
|
3126
3152
|
try {
|
|
3127
3153
|
const { data } = await (getGeminiTranscript == null ? void 0 : getGeminiTranscript({
|
|
3128
3154
|
audioUrl,
|