Skip to content
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

Merged

Conversation

kakiha11
Copy link
Contributor

@kakiha11 kakiha11 commented Apr 5, 2024

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
instructionsinprompt

A console log statement output demonstrating that the instructions have been added to the system prompt
image

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@kakiha11 kakiha11 requested a review from ebeastlake April 5, 2024 17:45
@@ -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;
};
Copy link
Contributor

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;
  };

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@ebeastlake ebeastlake left a 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!

@kakiha11 kakiha11 merged commit 5db5702 into staging Apr 9, 2024
2 checks passed
@kakiha11 kakiha11 deleted the ct-245/level-instructions-included-in-ai-tutor-prompt branch April 9, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants