@speakableio/core 0.1.85 → 0.1.86
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 +5 -1
- package/dist/index.native.d.ts +5 -1
- package/dist/index.native.js +3 -8
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +3 -8
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +5 -1
- package/dist/index.web.js +3 -8
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.web.d.mts
CHANGED
|
@@ -2352,7 +2352,7 @@ declare const useUpdateStudentVocab: (page: PageActivityWithId | null) => {
|
|
|
2352
2352
|
studentVocabMarkVoiceFail: () => Promise<void>;
|
|
2353
2353
|
};
|
|
2354
2354
|
|
|
2355
|
-
declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onCompletionSuccess, onCompletionError, aiEnabled, submitAudioResponse, uploadAudioAndGetTranscript, }: {
|
|
2355
|
+
declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onCompletionSuccess, onCompletionError, aiEnabled, submitAudioResponse, uploadAudioAndGetTranscript, onUploadAndTranscript, }: {
|
|
2356
2356
|
onTranscriptSuccess: (transcript: string) => void;
|
|
2357
2357
|
onTranscriptError: ({ type, message }: {
|
|
2358
2358
|
type: string;
|
|
@@ -2369,6 +2369,10 @@ declare const useBaseOpenAI: ({ onTranscriptSuccess, onTranscriptError, onComple
|
|
|
2369
2369
|
fileName: string;
|
|
2370
2370
|
}>;
|
|
2371
2371
|
uploadAudioAndGetTranscript: (audio: string, language: string) => Promise<string>;
|
|
2372
|
+
onUploadAndTranscript: (args: {
|
|
2373
|
+
transcript?: string;
|
|
2374
|
+
audioUrl?: string;
|
|
2375
|
+
}) => void;
|
|
2372
2376
|
}) => {
|
|
2373
2377
|
submitAudioResponse: (audio: string) => Promise<{
|
|
2374
2378
|
url: string;
|
package/dist/index.web.js
CHANGED
|
@@ -2956,7 +2956,8 @@ var useBaseOpenAI = ({
|
|
|
2956
2956
|
onCompletionError,
|
|
2957
2957
|
aiEnabled,
|
|
2958
2958
|
submitAudioResponse,
|
|
2959
|
-
uploadAudioAndGetTranscript
|
|
2959
|
+
uploadAudioAndGetTranscript,
|
|
2960
|
+
onUploadAndTranscript
|
|
2960
2961
|
}) => {
|
|
2961
2962
|
const { user, queryClient } = useSpeakableApi();
|
|
2962
2963
|
const currentUserId = user.auth.uid;
|
|
@@ -2971,14 +2972,7 @@ var useBaseOpenAI = ({
|
|
|
2971
2972
|
audioUrl,
|
|
2972
2973
|
language
|
|
2973
2974
|
}));
|
|
2974
|
-
console.log("response (getTranscript) from getAssemblyAITranscript", {
|
|
2975
|
-
response,
|
|
2976
|
-
audioUrl,
|
|
2977
|
-
language,
|
|
2978
|
-
getAssemblyAITranscript
|
|
2979
|
-
});
|
|
2980
2975
|
const transcript = response == null ? void 0 : response.data;
|
|
2981
|
-
onTranscriptSuccess(transcript);
|
|
2982
2976
|
return transcript;
|
|
2983
2977
|
} catch (error) {
|
|
2984
2978
|
console.log("error", error);
|
|
@@ -3060,6 +3054,7 @@ var useBaseOpenAI = ({
|
|
|
3060
3054
|
if (feedbackAccess == null ? void 0 : feedbackAccess.canAccessFeedback) {
|
|
3061
3055
|
transcript = await getTranscript(audio, language);
|
|
3062
3056
|
onTranscriptSuccess(transcript);
|
|
3057
|
+
onUploadAndTranscript({ transcript, audioUrl: audio });
|
|
3063
3058
|
} else {
|
|
3064
3059
|
console.info(
|
|
3065
3060
|
`Transcript not available: ${(feedbackAccess == null ? void 0 : feedbackAccess.reason) || "No feedback access"}`
|