@speakableio/core 0.1.88 → 0.1.90
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 +8 -2
- package/dist/index.native.d.ts +8 -2
- package/dist/index.native.js +8 -4
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +8 -4
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +8 -2
- package/dist/index.web.js +8 -4
- package/dist/index.web.js.map +1 -1
- package/package.json +1 -1
package/dist/index.native.mjs
CHANGED
|
@@ -2803,7 +2803,7 @@ var useUpdateStudentVocab = (page) => {
|
|
|
2803
2803
|
} catch (error) {
|
|
2804
2804
|
if (error instanceof Error && error.message === "not-found") {
|
|
2805
2805
|
data.firstSeen = serverTimestamp2();
|
|
2806
|
-
await api.setDoc(docPath, data);
|
|
2806
|
+
await api.setDoc(docPath, data, { merge: true });
|
|
2807
2807
|
} else {
|
|
2808
2808
|
console.log(error);
|
|
2809
2809
|
}
|
|
@@ -2825,7 +2825,7 @@ var useUpdateStudentVocab = (page) => {
|
|
|
2825
2825
|
} catch (error) {
|
|
2826
2826
|
if (error instanceof Error && error.message === "not-found") {
|
|
2827
2827
|
data.firstSeen = serverTimestamp2();
|
|
2828
|
-
await api.setDoc(docPath, data);
|
|
2828
|
+
await api.setDoc(docPath, data, { merge: true });
|
|
2829
2829
|
} else {
|
|
2830
2830
|
console.log(error);
|
|
2831
2831
|
}
|
|
@@ -3047,22 +3047,26 @@ var useBaseOpenAI = ({
|
|
|
3047
3047
|
return result;
|
|
3048
3048
|
}
|
|
3049
3049
|
let transcript;
|
|
3050
|
+
let audioUrl = void 0;
|
|
3050
3051
|
if (writtenResponse) {
|
|
3051
3052
|
transcript = writtenResponse;
|
|
3052
3053
|
onTranscriptSuccess(writtenResponse);
|
|
3053
3054
|
} else if (typeof audio === "string" && file) {
|
|
3054
3055
|
if (feedbackAccess == null ? void 0 : feedbackAccess.canAccessFeedback) {
|
|
3055
3056
|
transcript = await getTranscript(audio, language);
|
|
3057
|
+
audioUrl = audio;
|
|
3056
3058
|
onTranscriptSuccess(transcript);
|
|
3057
|
-
onGetAudioUrlAndTranscript == null ? void 0 : onGetAudioUrlAndTranscript({ transcript, audioUrl: audio });
|
|
3058
3059
|
} else {
|
|
3059
3060
|
console.info(
|
|
3060
3061
|
`Transcript not available: ${(feedbackAccess == null ? void 0 : feedbackAccess.reason) || "No feedback access"}`
|
|
3061
3062
|
);
|
|
3062
3063
|
}
|
|
3063
3064
|
} else {
|
|
3064
|
-
|
|
3065
|
+
const response = await uploadAudioAndGetTranscript(audio || "", language);
|
|
3066
|
+
transcript = response.transcript;
|
|
3067
|
+
audioUrl = response.audioUrl;
|
|
3065
3068
|
}
|
|
3069
|
+
onGetAudioUrlAndTranscript == null ? void 0 : onGetAudioUrlAndTranscript({ transcript, audioUrl });
|
|
3066
3070
|
if (feedbackAccess == null ? void 0 : feedbackAccess.canAccessFeedback) {
|
|
3067
3071
|
const results = await getAIResponse({
|
|
3068
3072
|
cardId,
|