@speakableio/core 0.1.47 → 0.1.49

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.
@@ -2705,9 +2705,6 @@ var useActivityFeedbackAccess = ({
2705
2705
  };
2706
2706
 
2707
2707
  // src/hooks/useOpenAI.ts
2708
- var getGeminiFeedback = SpeakableFirebaseFunctions.getGeminiFeedback;
2709
- var getProficiencyEstimate = SpeakableFirebaseFunctions.getProficiencyEstimate;
2710
- var getAssemblyAITranscript = SpeakableFirebaseFunctions.getAssemblyAITranscript;
2711
2708
  var useBaseOpenAI = ({
2712
2709
  onTranscriptSuccess,
2713
2710
  onTranscriptError,
@@ -2723,8 +2720,9 @@ var useBaseOpenAI = ({
2723
2720
  aiEnabled
2724
2721
  });
2725
2722
  const getTranscript = async (audioUrl, language) => {
2723
+ var _a2, _b2, _c2, _d2;
2726
2724
  try {
2727
- const response = await (getAssemblyAITranscript == null ? void 0 : getAssemblyAITranscript({
2725
+ const response = await ((_b2 = (_a2 = SpeakableFirebaseFunctions).getAssemblyAITranscript) == null ? void 0 : _b2.call(_a2, {
2728
2726
  audioUrl,
2729
2727
  language
2730
2728
  }));
@@ -2732,7 +2730,7 @@ var useBaseOpenAI = ({
2732
2730
  response,
2733
2731
  audioUrl,
2734
2732
  language,
2735
- getAssemblyAITranscript
2733
+ getAssemblyAITranscript: (_d2 = (_c2 = api).httpsCallable) == null ? void 0 : _d2.call(_c2, "transcribeAssemblyAIAudio")
2736
2734
  });
2737
2735
  const transcript = response == null ? void 0 : response.data;
2738
2736
  onTranscriptSuccess(transcript);
@@ -2855,7 +2853,7 @@ var useBaseOpenAI = ({
2855
2853
  }
2856
2854
  };
2857
2855
  const getAIResponse = async ({ cardId, transcript }) => {
2858
- var _a2;
2856
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
2859
2857
  try {
2860
2858
  const card = getCardFromCache({
2861
2859
  cardId,
@@ -2866,12 +2864,12 @@ var useBaseOpenAI = ({
2866
2864
  if (card && card.grading_method === "manual") {
2867
2865
  } else if (card && card.grading_method !== "standards_based") {
2868
2866
  const [geminiResult, proficiencyResult] = await Promise.all([
2869
- getGeminiFeedback == null ? void 0 : getGeminiFeedback({
2867
+ (_b2 = (_a2 = SpeakableFirebaseFunctions).getGeminiFeedback) == null ? void 0 : _b2.call(_a2, {
2870
2868
  cardId,
2871
2869
  studentId: currentUserId,
2872
2870
  studentResponse: transcript
2873
2871
  }),
2874
- getProficiencyEstimate == null ? void 0 : getProficiencyEstimate({
2872
+ (_d2 = (_c2 = SpeakableFirebaseFunctions).getProficiencyEstimate) == null ? void 0 : _d2.call(_c2, {
2875
2873
  cardId,
2876
2874
  studentId: currentUserId,
2877
2875
  studentResponse: transcript
@@ -2879,12 +2877,12 @@ var useBaseOpenAI = ({
2879
2877
  ]);
2880
2878
  proficiencyData = (proficiencyResult == null ? void 0 : proficiencyResult.data) || {};
2881
2879
  feedbackData = {
2882
- ...(_a2 = geminiResult == null ? void 0 : geminiResult.data) != null ? _a2 : {},
2880
+ ...(_e2 = geminiResult == null ? void 0 : geminiResult.data) != null ? _e2 : {},
2883
2881
  // @ts-ignore
2884
2882
  proficiency_level: (proficiencyData == null ? void 0 : proficiencyData.proficiency_level) || null
2885
2883
  };
2886
2884
  } else {
2887
- const geminiResult = await (getGeminiFeedback == null ? void 0 : getGeminiFeedback({
2885
+ const geminiResult = await ((_g2 = (_f2 = SpeakableFirebaseFunctions).getGeminiFeedback) == null ? void 0 : _g2.call(_f2, {
2888
2886
  cardId,
2889
2887
  studentId: currentUserId,
2890
2888
  studentResponse: transcript