New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Level instructions included in ai tutor prompt #57835
Level instructions included in ai tutor prompt #57835
Conversation
@@ -51,6 +55,9 @@ export const askAITutor = createAsyncThunk( | |||
'aitutor/askAITutor', | |||
async (chatContext: ChatContext, thunkAPI) => { | |||
const state = thunkAPI.getState() as {aiTutor: AITutorState}; | |||
const instructionsState = thunkAPI.getState() as { | |||
instructions: InstructionsState; | |||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kakiha11 I think you should be able to combine these!
const { aiTutor, instructions } = thunkAPI.getState() as {
aiTutor: AITutorState;
instructions: InstructionsState;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ebeastlake That exact change didn't work, but I made updates to only call thunkAPI.getState()
one time. There is a larger diff now since I needed to update state
to aiTutorState
throughout the rest of this export chunk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you also update the reference to instructions below it when you tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! The variable name is now levelInstructions
and has been updated where it's used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth making the change I commented on before merging, but this looks good to me!
Warning!!
The AP CSP Create Performance Task is in progress. The most critical dates are from April 3 - April 30, 2024. Please consider any risk introduced by this PR that could affect our students taking AP CSP. Code.org students taking AP CSP primarily use App Lab for their Create Task, however a small percent use Game Lab. Carefully consider whether your change has any risk of alterering, changing, or breaking anything in these two labs. Even small changes, such as a different button color, are considered significant during this time period. Reach out to the Student Learning team or Curriculum team for more details.
Including the instructions from a level with the AI Tutor system prompt to give the tutor context for the task on the level.
Showing the tutor can respond to prompts about the instructions
A console log statement output demonstrating that the instructions have been added to the system prompt
Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: