@speakableio/core 0.1.33 → 0.1.35
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 +2 -3
- package/dist/index.native.mjs +5 -13
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.web.d.mts +2 -3
- package/dist/index.web.js +5 -13
- 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
|
-
|
|
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;
|
|
@@ -2249,10 +2249,9 @@ interface ActivityFeedbackAccess {
|
|
|
2249
2249
|
* @param params - Parameters for permission checking
|
|
2250
2250
|
* @returns Feedback permissions information
|
|
2251
2251
|
*/
|
|
2252
|
-
declare const useActivityFeedbackAccess: ({ aiEnabled, isActivityRoute,
|
|
2252
|
+
declare const useActivityFeedbackAccess: ({ aiEnabled, isActivityRoute, }: {
|
|
2253
2253
|
aiEnabled?: boolean;
|
|
2254
2254
|
isActivityRoute?: boolean;
|
|
2255
|
-
isAssignmentRoute?: boolean;
|
|
2256
2255
|
}) => {
|
|
2257
2256
|
data: ActivityFeedbackAccess;
|
|
2258
2257
|
error: Error;
|
package/dist/index.web.js
CHANGED
|
@@ -2605,8 +2605,7 @@ var activityFeedbackAccessQueryKeys = {
|
|
|
2605
2605
|
};
|
|
2606
2606
|
var useActivityFeedbackAccess = ({
|
|
2607
2607
|
aiEnabled = false,
|
|
2608
|
-
isActivityRoute = false
|
|
2609
|
-
isAssignmentRoute = false
|
|
2608
|
+
isActivityRoute = false
|
|
2610
2609
|
}) => {
|
|
2611
2610
|
var _a, _b, _c;
|
|
2612
2611
|
const { user } = useSpeakableApi();
|
|
@@ -2614,17 +2613,10 @@ var useActivityFeedbackAccess = ({
|
|
|
2614
2613
|
const isTeacher = (_a = user.profile) == null ? void 0 : _a.isTeacher;
|
|
2615
2614
|
const isStudent = (_b = user.profile) == null ? void 0 : _b.isStudent;
|
|
2616
2615
|
const userRoles = ((_c = user.profile) == null ? void 0 : _c.roles) || [];
|
|
2617
|
-
const { data: userCredits } = useUserCredits();
|
|
2618
|
-
const { data: organizationAccess } = useOrganizationAccess();
|
|
2619
2616
|
const query2 = useQuery6({
|
|
2620
2617
|
queryKey: activityFeedbackAccessQueryKeys.activityFeedbackAccess({
|
|
2621
2618
|
aiEnabled,
|
|
2622
|
-
|
|
2623
|
-
isAssignmentRoute,
|
|
2624
|
-
isActivityRoute,
|
|
2625
|
-
uid,
|
|
2626
|
-
organizationAccess: organizationAccess != null ? organizationAccess : null,
|
|
2627
|
-
userCredits
|
|
2619
|
+
isActivityRoute
|
|
2628
2620
|
}),
|
|
2629
2621
|
queryFn: async () => {
|
|
2630
2622
|
var _a2, _b2;
|
|
@@ -2729,7 +2721,7 @@ var useBaseOpenAI = ({
|
|
|
2729
2721
|
const { data: feedbackAccess } = useActivityFeedbackAccess({
|
|
2730
2722
|
aiEnabled
|
|
2731
2723
|
});
|
|
2732
|
-
const
|
|
2724
|
+
const getTranscript = async (audioUrl, language) => {
|
|
2733
2725
|
try {
|
|
2734
2726
|
const { data: transcript } = await (getAssemblyAITranscript == null ? void 0 : getAssemblyAITranscript({
|
|
2735
2727
|
audioUrl,
|
|
@@ -2814,7 +2806,7 @@ var useBaseOpenAI = ({
|
|
|
2814
2806
|
onTranscriptSuccess(writtenResponse);
|
|
2815
2807
|
} else if (typeof audio === "string" && file) {
|
|
2816
2808
|
if (feedbackAccess == null ? void 0 : feedbackAccess.canAccessFeedback) {
|
|
2817
|
-
transcript = await
|
|
2809
|
+
transcript = await getTranscript(audio, language);
|
|
2818
2810
|
onTranscriptSuccess(transcript);
|
|
2819
2811
|
} else {
|
|
2820
2812
|
console.info(
|
|
@@ -2909,7 +2901,7 @@ var useBaseOpenAI = ({
|
|
|
2909
2901
|
return {
|
|
2910
2902
|
submitAudioResponse,
|
|
2911
2903
|
uploadAudioAndGetTranscript,
|
|
2912
|
-
|
|
2904
|
+
getTranscript,
|
|
2913
2905
|
getFreeResponseCompletion,
|
|
2914
2906
|
getFeedback
|
|
2915
2907
|
};
|