-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add persona selection to AI qs #898
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
Conversation
|
/gemini summary |
|
/gemini review |
Summary of ChangesThis pull request introduces a new feature to the AI application, enabling users to select or define a 'persona' for the AI model. This functionality leverages system instructions to guide the AI's conversational style, allowing for more tailored and engaging interactions. The changes involve adding a new UI element to the sidebar for persona selection, implementing the logic to apply these personas to the AI model's parameters, and structuring the predefined persona data. Highlights
Changelog
Activity
|
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.
Code Review
This pull request adds a persona selection feature to the AI chat interface, allowing users to set a system instruction for the model from a list of predefined personas or a custom one. The changes include new UI components in the left sidebar, state management for the selected persona, and a useEffect to update the model parameters. I've identified a few areas for improvement regarding CSS maintainability, UI/UX on button states, and code simplification in the React component.
|
/gemini review |
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.
Code Review
This pull request successfully adds a persona selection feature to the chat interface, allowing users to apply system instructions to the AI model. The implementation is solid, introducing a new configuration file for personas and updating the sidebar component with the necessary state management and UI elements. My review includes a couple of suggestions to improve code clarity and type safety in the new TypeScript code, primarily by leveraging useMemo for derived state and as const for constant data structures. These changes will enhance the maintainability of the new feature.
|
/gemini review |
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.
Code Review
This pull request successfully introduces a persona selection feature for the AI chat, allowing users to apply system instructions through a dropdown menu in the left sidebar. The implementation includes a new set of predefined personas, updates to the UI components to support this selection, and the necessary state management to pass the selected persona's system instruction to the generative model.
The code is generally well-structured. I've identified a couple of areas for improvement:
- A potential UI state inconsistency in the
LeftSidebarwhere it may not reflect external changes to the persona settings. - A minor inconsistency in HTML heading levels between the left and right sidebars.
Addressing these points will improve the robustness and maintainability of the new feature.
|
/gemini review |
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.
Code Review
This pull request introduces a persona selection feature, enhancing user interaction by allowing system instructions to be configured. The implementation is well-structured, with clear separation of concerns. Suggestions focus on improving robustness and maintainability by using constants and memoization.
Co-authored-by: Daniel La Rocque <dlarocque@google.com>
Co-authored-by: Daniel La Rocque <dlarocque@google.com>
Co-authored-by: Daniel La Rocque <dlarocque@google.com>
dlarocque
left a comment
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.
Ty!
|
@dlarocque Thanks for helping me through it! |
Partnered with Gemini CLI to add Persona support to demonstrate system instructions: