@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.
@@ -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;
@@ -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;
@@ -2244,9 +2244,22 @@ var createSetRepo = () => {
2244
2244
 
2245
2245
  // src/utils/ai/get-transcript.ts
2246
2246
  async function getTranscript(model, args) {
2247
- var _a, _b, _c, _d;
2247
+ var _a, _b, _c, _d, _e, _f;
2248
2248
  const getGeminiTranscript = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "getGeminiTranscript");
2249
2249
  const getAssemblyAITranscript = (_d = (_c = api).httpsCallable) == null ? void 0 : _d.call(_c, "transcribeAssemblyAIAudio");
2250
+ const getWhisperTranscript = (_f = (_e = api).httpsCallable) == null ? void 0 : _f.call(_e, "transcribeAudio");
2251
+ if (model === "whisper") {
2252
+ try {
2253
+ const { data } = await (getWhisperTranscript == null ? void 0 : getWhisperTranscript({
2254
+ audioUrl: args.audioUrl,
2255
+ language: args.language
2256
+ }));
2257
+ return data;
2258
+ } catch (error) {
2259
+ console.error("Error getting transcript from Whisper:", error);
2260
+ throw error;
2261
+ }
2262
+ }
2250
2263
  if (model === "gemini") {
2251
2264
  try {
2252
2265
  const { data } = await (getGeminiTranscript == null ? void 0 : getGeminiTranscript({
@@ -3228,9 +3241,22 @@ var useBaseOpenAI = ({
3228
3241
  aiEnabled
3229
3242
  });
3230
3243
  const getTranscript2 = async (audioUrl, language, prompt) => {
3231
- var _a, _b, _c, _d;
3244
+ var _a, _b, _c, _d, _e, _f;
3232
3245
  const getGeminiTranscript = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "getGeminiTranscript");
3233
3246
  const getAssemblyAITranscript = (_d = (_c = api).httpsCallable) == null ? void 0 : _d.call(_c, "transcribeAssemblyAIAudio");
3247
+ const getWhisperTranscript = (_f = (_e = api).httpsCallable) == null ? void 0 : _f.call(_e, "transcribeAudio");
3248
+ try {
3249
+ const { data } = await (getWhisperTranscript == null ? void 0 : getWhisperTranscript({
3250
+ audioUrl,
3251
+ language
3252
+ }));
3253
+ const transcript = data;
3254
+ if (transcript) {
3255
+ return transcript;
3256
+ }
3257
+ } catch (error) {
3258
+ console.log("Whisper transcript failed, trying Gemini fallback:", error);
3259
+ }
3234
3260
  try {
3235
3261
  const { data } = await (getGeminiTranscript == null ? void 0 : getGeminiTranscript({
3236
3262
  audioUrl,