Skip to content

Commit 27ab0db

Browse files
Move the Khanmigo data functions to Perseus Core for Server Side Scoring initiative (#3091)
## Summary: This PR moves `getAnswersFromWidget`, `injectWidgets`, and a handful of helper functions to Perseus Core so that they are available for the Perseus service. We will be creating a new API endpoint to call these functions, so that we can support Khanmigo's move to keeping answerful data server-side. It also created the new `getPerseusAIData` function, which will be used for the new API Endpoint. **I'm happy to take any direction on the name**, as "getPromptJSON" didn't feel the most descriptive or correct to myself or the AI team. I don't feel like I've nailed the perfect name either, but it seemed clearer at least. Issue: LEMS-3766 ## Test plan: - Tests pass - Tests pass upstream - Integration works upstream Author: SonicScrewdriver Reviewers: SonicScrewdriver, handeyeco, jeremywiebe, benchristel Required Reviewers: Approved By: handeyeco Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3091
1 parent 130db84 commit 27ab0db

File tree

8 files changed

+2075
-1781
lines changed

8 files changed

+2075
-1781
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@khanacademy/perseus": minor
3+
"@khanacademy/perseus-core": minor
4+
---
5+
6+
Move the Khanmigo data functions to Perseus Core for Server Side Scoring initiative

packages/perseus-core/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ export {
217217
} from "./utils/generators/image-widget-generator";
218218
export {generateVideoWidget} from "./utils/generators/video-widget-generator";
219219

220+
export {
221+
getAnswersFromWidgets,
222+
injectWidgets,
223+
getPerseusAIData,
224+
} from "./utils/extract-perseus-ai-data";
225+
220226
import {registerCoreWidgets} from "./widgets/core-widget-registry";
221227

222228
registerCoreWidgets();

0 commit comments

Comments
 (0)