@speakableio/core 0.1.48 → 0.1.50
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 +1 -1
- package/dist/index.native.mjs +11 -7
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +1 -1
- package/dist/index.web.js +11 -7
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.web.d.mts
CHANGED
|
@@ -2209,7 +2209,7 @@ declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onComple
|
|
|
2209
2209
|
fileName: string;
|
|
2210
2210
|
}>;
|
|
2211
2211
|
uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<string>;
|
|
2212
|
-
getTranscript: (audioUrl: string, language: string) => Promise<
|
|
2212
|
+
getTranscript: (audioUrl: string, language: string) => Promise<string>;
|
|
2213
2213
|
getFreeResponseCompletion: (messages: string[], isFreeResponse: boolean, feedbackLanguage: string, gradingStandard?: string) => Promise<any>;
|
|
2214
2214
|
getFeedback: ({ cardId, language, writtenResponse, audio, autoGrade, file, }: {
|
|
2215
2215
|
cardId: string;
|
package/dist/index.web.js
CHANGED
|
@@ -2722,7 +2722,8 @@ var useBaseOpenAI = ({
|
|
|
2722
2722
|
const getTranscript = async (audioUrl, language) => {
|
|
2723
2723
|
var _a2, _b2;
|
|
2724
2724
|
try {
|
|
2725
|
-
const
|
|
2725
|
+
const getAssemblyAITranscript = (_b2 = (_a2 = api).httpsCallable) == null ? void 0 : _b2.call(_a2, "transcribeAssemblyAIAudio");
|
|
2726
|
+
const response = await (getAssemblyAITranscript == null ? void 0 : getAssemblyAITranscript({
|
|
2726
2727
|
audioUrl,
|
|
2727
2728
|
language
|
|
2728
2729
|
}));
|
|
@@ -2730,7 +2731,7 @@ var useBaseOpenAI = ({
|
|
|
2730
2731
|
response,
|
|
2731
2732
|
audioUrl,
|
|
2732
2733
|
language,
|
|
2733
|
-
getAssemblyAITranscript
|
|
2734
|
+
getAssemblyAITranscript
|
|
2734
2735
|
});
|
|
2735
2736
|
const transcript = response == null ? void 0 : response.data;
|
|
2736
2737
|
onTranscriptSuccess(transcript);
|
|
@@ -2751,6 +2752,7 @@ var useBaseOpenAI = ({
|
|
|
2751
2752
|
standard: gradingStandard
|
|
2752
2753
|
});
|
|
2753
2754
|
try {
|
|
2755
|
+
const createChatCompletion = (_b2 = (_a2 = api).httpsCallable) == null ? void 0 : _b2.call(_a2, "createChatCompletion");
|
|
2754
2756
|
const {
|
|
2755
2757
|
data: {
|
|
2756
2758
|
response,
|
|
@@ -2759,7 +2761,7 @@ var useBaseOpenAI = ({
|
|
|
2759
2761
|
success: aiSuccess = false
|
|
2760
2762
|
// the AI was able to generate a response
|
|
2761
2763
|
}
|
|
2762
|
-
} = await (
|
|
2764
|
+
} = await (createChatCompletion == null ? void 0 : createChatCompletion({
|
|
2763
2765
|
chat: {
|
|
2764
2766
|
model: isFreeResponse ? "gpt-4-1106-preview" : "gpt-3.5-turbo-1106",
|
|
2765
2767
|
messages,
|
|
@@ -2853,8 +2855,10 @@ var useBaseOpenAI = ({
|
|
|
2853
2855
|
}
|
|
2854
2856
|
};
|
|
2855
2857
|
const getAIResponse = async ({ cardId, transcript }) => {
|
|
2856
|
-
var _a2, _b2, _c2, _d2, _e2
|
|
2858
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
2857
2859
|
try {
|
|
2860
|
+
const getGeminiFeedback = (_b2 = (_a2 = api).httpsCallable) == null ? void 0 : _b2.call(_a2, "callGetFeedback");
|
|
2861
|
+
const getProficiencyEstimate = (_d2 = (_c2 = api).httpsCallable) == null ? void 0 : _d2.call(_c2, "getProficiencyEstimate");
|
|
2858
2862
|
const card = getCardFromCache({
|
|
2859
2863
|
cardId,
|
|
2860
2864
|
queryClient
|
|
@@ -2864,12 +2868,12 @@ var useBaseOpenAI = ({
|
|
|
2864
2868
|
if (card && card.grading_method === "manual") {
|
|
2865
2869
|
} else if (card && card.grading_method !== "standards_based") {
|
|
2866
2870
|
const [geminiResult, proficiencyResult] = await Promise.all([
|
|
2867
|
-
|
|
2871
|
+
getGeminiFeedback == null ? void 0 : getGeminiFeedback({
|
|
2868
2872
|
cardId,
|
|
2869
2873
|
studentId: currentUserId,
|
|
2870
2874
|
studentResponse: transcript
|
|
2871
2875
|
}),
|
|
2872
|
-
|
|
2876
|
+
getProficiencyEstimate == null ? void 0 : getProficiencyEstimate({
|
|
2873
2877
|
cardId,
|
|
2874
2878
|
studentId: currentUserId,
|
|
2875
2879
|
studentResponse: transcript
|
|
@@ -2882,7 +2886,7 @@ var useBaseOpenAI = ({
|
|
|
2882
2886
|
proficiency_level: (proficiencyData == null ? void 0 : proficiencyData.proficiency_level) || null
|
|
2883
2887
|
};
|
|
2884
2888
|
} else {
|
|
2885
|
-
const geminiResult = await (
|
|
2889
|
+
const geminiResult = await (getGeminiFeedback == null ? void 0 : getGeminiFeedback({
|
|
2886
2890
|
cardId,
|
|
2887
2891
|
studentId: currentUserId,
|
|
2888
2892
|
studentResponse: transcript
|