@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.
@@ -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,