-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Turbo script for creating development prompts
- Loading branch information
Showing
23 changed files
with
1,680 additions
and
710 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { LLMResponseJsonSchema } from "../../../../aila/src/protocol/jsonPatchProtocol"; | ||
import { LessonPlanJsonSchema } from "../../../../aila/src/protocol/schema"; | ||
import { template as newTemplate, TemplateProps } from "./index"; | ||
import { template as oldTemplate } from "./old"; | ||
|
||
// Whilst refactoring the Aila template so that we can store versioning | ||
// information, we want to make sure that the prompt generated by the new | ||
// template is the same as the prompt generated by the old template. | ||
describe("Lesson Assistant Template", () => { | ||
const testCases: [string, TemplateProps][] = [ | ||
[ | ||
"interactive with RAG and baseLessonPlan", | ||
{ | ||
subject: "Mathematics", | ||
keyStage: "KS3", | ||
topic: "Algebra", | ||
relevantLessonPlans: "Some relevant plans", | ||
currentLessonPlan: "Current plan", | ||
summaries: "Some summaries", | ||
lessonTitle: "Introduction to Equations", | ||
responseMode: "interactive", | ||
baseLessonPlan: "Base lesson plan", | ||
useRag: true, | ||
americanisms: [{ word: "color", replacement: "colour" }], | ||
lessonPlanJsonSchema: JSON.stringify(LessonPlanJsonSchema), | ||
llmResponseJsonSchema: JSON.stringify(LLMResponseJsonSchema), | ||
}, | ||
], | ||
[ | ||
"generate without RAG or baseLessonPlan", | ||
{ | ||
subject: "English", | ||
keyStage: "KS2", | ||
topic: "Poetry", | ||
relevantLessonPlans: "Some relevant plans", | ||
currentLessonPlan: "Current plan", | ||
summaries: "Some summaries", | ||
lessonTitle: "Rhyme and Rhythm", | ||
responseMode: "generate", | ||
useRag: false, | ||
lessonPlanJsonSchema: JSON.stringify(LessonPlanJsonSchema), | ||
llmResponseJsonSchema: JSON.stringify(LLMResponseJsonSchema), | ||
}, | ||
], | ||
[ | ||
"interactive without RAG but with baseLessonPlan", | ||
{ | ||
subject: "Science", | ||
keyStage: "KS4", | ||
topic: "Chemistry", | ||
relevantLessonPlans: "Some relevant plans", | ||
currentLessonPlan: "Current plan", | ||
summaries: "Some summaries", | ||
lessonTitle: "Chemical Bonding", | ||
responseMode: "interactive", | ||
baseLessonPlan: "Base lesson plan", | ||
useRag: false, | ||
americanisms: [], | ||
lessonPlanJsonSchema: JSON.stringify(LessonPlanJsonSchema), | ||
llmResponseJsonSchema: JSON.stringify(LLMResponseJsonSchema), | ||
}, | ||
], | ||
]; | ||
|
||
test.each(testCases)("%s", (_, props) => { | ||
const newResult = newTemplate(props); | ||
const oldResult = oldTemplate(props); | ||
|
||
// Compare the results | ||
expect(newResult).toBe(oldResult); | ||
}); | ||
}); |
Oops, something went wrong.