Closed ryanmio closed 10 months ago
Name | Link |
---|---|
Latest commit | 9a8a373a6917c1b25a1201c23c791d15044becc5 |
Latest deploy log | https://app.netlify.com/sites/decode-me/deploys/6590be1978fd9100083c0cc5 |
Deploy Preview | https://deploy-preview-33--decode-me.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This PR implements a new feature that allows users to set custom instructions for their gameplay. These custom instructions are used to modify the prompts sent to the OpenAI API, providing a more personalized and engaging user experience.
Major Changes
User Document Update: The user document in Firestore is updated to include a
customInstructions
field. This field stores the custom instructions set by the user.Assistant Settings Page: The Assistant Settings page (
assistantSettings/[userId].js
) is updated to include a form for setting custom instructions. The form includes a textarea for each type of custom instruction (e.g.,codeGen
). The user's current custom instructions are fetched from Firestore and displayed in the form. When the form is submitted, the user's custom instructions in Firestore are updated.Fetching Custom Instructions: In the home page (
index.js
), the custom instructions are fetched from Firestore along with the learning level. The custom instructions are then passed to thehandleCodeSnippetFetch
function.Passing Custom Instructions to Cloud Function: The custom instructions are included in the body of the fetch request to the
getCodeSnippet
cloud function. This allows the cloud function to use the custom instructions when generating the system message for the OpenAI API.Using Custom Instructions in Cloud Function: The
getCodeSnippet
cloud function inUntitled-1.js
is updated to extract thecustomInstructions
from the request body and use them in the system message. ThecodeGen
custom instruction is specifically used in the system message.Options Menu Update: The Options Menu (
OptionsMenu.js
) is updated to include a new option for Assistant Settings. When this option is clicked, the user is navigated to the Assistant Settings page.Testing
The feature has been manually tested and confirmed to work as expected. The custom instructions set by the user are successfully used in the prompts sent to the OpenAI API.
Impact
This feature enhances the user experience by allowing users to personalize the prompts used in their gameplay. It also provides a foundation for further customization and personalization features in the future.