Skip to content

Commit

Permalink
chore: reduce prompt step logging (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefl authored Nov 7, 2024
1 parent b2e525c commit 9af9b11
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ These values are not all present, so ask the user for the missing values.`,

hasRelevantLessons && !Object.keys(lessonPlan).includes("basedOn")
? {
title: "ASK THE USER IF THEY WANT TO BASE THEIR LESSON PLAN ON AN EXISTING LESSON",
title:
"ASK THE USER IF THEY WANT TO BASE THEIR LESSON PLAN ON AN EXISTING LESSON",
content: `Ask if the user would like to adapt one of the Oak lessons as a starting point for their new lesson.
Provide a list of lessons for the user as numbered options, with the title of each lesson.
The user will then respond with the number of the lesson they would like to adapt.
Expand Down Expand Up @@ -64,7 +65,8 @@ In some cases it is possible for the user to base their lesson on existing ones,
}
: {
sections: ["learningOutcome", "learningCycles"] as LessonPlanKeys[],
title: "GENERATE SECTION GROUP [basedOn, learningOutcome, learningCycles]",
title:
"GENERATE SECTION GROUP [basedOn, learningOutcome, learningCycles]",
content: `You need to generate three sections in one interaction with the user. Do these all in one interaction.
* basedOn - store the reference to the basedOn lesson in the lesson plan unless it is already set.
* learningOutcome - generate learning outcomes.
Expand All @@ -86,14 +88,16 @@ Generate all of these sections together and respond to the user within this one
"misconceptions",
"keywords",
],
title: "GENERATE SECTION GROUP [priorKnowledge, keyLearningPoints, misconceptions, keywords]",
title:
"GENERATE SECTION GROUP [priorKnowledge, keyLearningPoints, misconceptions, keywords]",
content: `Generate these four sections together in one single interaction.
You should not ask the user for feedback after generating them one-by-one.
Generate them all together in one response.`,
},
{
sections: ["starterQuiz", "cycle1", "cycle2", "cycle3", "exitQuiz"],
title: "GENERATE SECTION GROUP [starterQuiz, cycle1, cycle2, cycle3, exitQuiz]",
title:
"GENERATE SECTION GROUP [starterQuiz, cycle1, cycle2, cycle3, exitQuiz]",
content: `Generate the bulk of the lesson. Generate all of these sections in one interaction.
Your response should include the starter quiz, each of the three learning cycles, and the exit quiz all within a single response.
Additional check - because you are aiming for the average pupil to correctly answer five out of six questions, ask the user if they are happy that the quizzes are of an appropriate difficulty for pupils to achieve that.
Expand Down Expand Up @@ -161,11 +165,13 @@ export const interactingWithTheUser = ({
relevantLessonPlans,
}: TemplateProps) => {
const allSteps = lessonConstructionSteps(lessonPlan, relevantLessonPlans);

const step = allSteps[0]
? `${allSteps[0]?.title}\n\n${allSteps[0]?.content}`
: "FINAL STEP: Respond to the user and help them edit the lesson plan";
log.info("Prompt: next lesson step", JSON.stringify(step, null, 2));
const finalStep = {
title: "FINAL STEP",
content: "Respond to the user and help them edit the lesson plan",
};
const nextStep = allSteps[0] ?? finalStep;
const step = `${nextStep.title}\n\n${nextStep.content}`;
log.info("Prompt: next lesson step", nextStep.title);

const parts = [
`YOUR INSTRUCTIONS FOR INTERACTING WITH THE USER
Expand Down

0 comments on commit 9af9b11

Please sign in to comment.