Integrated Gemini into User Preferences - Backend #65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I currently have my "Ask AI" feature in pages, where users can ask Gemini the theme they are looking for on Open Coding Society, in accordance with what I had shown during the live review. I added my API Key to a .env file in Java Spring, and created 3 files in a folder called "geminiUserPreferences", located in "(repo)/src/main/java/com/open/spring/mvc". Together, my changes enable a user's preferences for different categories of styling to be sent to the backend. They are input as part of a prompt into Gemini, and Gemini's feedback is organized (split and assigned to variables) into the categorized types of styling. The output is sent to the frontend to be printed as the response, and the user is given an option to automatically implement Gemini's recommendations.
I also bypassed authentication for the user preferences api endpoint "/api/upai" so that access to the backend is not blocked (if the user is not logged in).