Conversation
Show notice and info thing about Prompt Amplifier
There was a problem hiding this comment.
Hello @mohnjiles, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request introduces a disclaimer dialog for the Prompt Amplifier feature, which uses the experimental Spark model. The disclaimer informs users that the Prompt Amplifier runs in a secure cloud environment and explains why it's not running locally. It also addresses privacy concerns, assuring users that their prompts and outputs are not used for AI training. The PR also adds the disclaimer text to the resource files for different languages.
Highlights
- Disclaimer Dialog: A disclaimer dialog is added to inform users about the Prompt Amplifier's cloud-based operation and privacy practices.
- Resource Files: Disclaimer text is added to resource files for English, Japanese, Simplified Chinese, and Traditional Chinese.
- Teaching Tip: A new teaching tip is added to track whether the user has seen the Prompt Amplifier disclaimer.
Changelog
Click here to see the changelog
- StabilityMatrix.Avalonia/Controls/Inference/PromptCard.axaml
- Added a button with an info icon to the PromptCard to show the Prompt Amplifier disclaimer.
- The button is bound to the
ShowAmplifierDisclaimerCommand.
- StabilityMatrix.Avalonia/Languages/Resources.Designer.cs
- Added a new resource string
PromptAmplifier_Disclaimercontaining the disclaimer text.
- Added a new resource string
- StabilityMatrix.Avalonia/Languages/Resources.ja-JP.resx
- Added a Japanese translation for the
PromptAmplifier_Disclaimerresource string.
- Added a Japanese translation for the
- StabilityMatrix.Avalonia/Languages/Resources.resx
- Added the
PromptAmplifier_Disclaimerresource string with the disclaimer text.
- Added the
- StabilityMatrix.Avalonia/Languages/Resources.zh-Hans.resx
- Added a Simplified Chinese translation for the
PromptAmplifier_Disclaimerresource string.
- Added a Simplified Chinese translation for the
- StabilityMatrix.Avalonia/Languages/Resources.zh-Hant.resx
- Added a Traditional Chinese translation for the
PromptAmplifier_Disclaimerresource string.
- Added a Traditional Chinese translation for the
- StabilityMatrix.Avalonia/ViewModels/Inference/PromptCardViewModel.cs
- Initialized
tokensRemainingto -1. - Added logic to display the Prompt Amplifier disclaimer dialog before amplifying the prompt if the user hasn't seen it before.
- Added a
ShowAmplifierDisclaimerCommandto show the disclaimer dialog. - Added a check to see if the user has seen the
PromptAmplifyDisclaimerteaching tip.
- Initialized
- StabilityMatrix.Core/Models/Settings/TeachingTip.cs
- Added a new
TeachingTipforPromptAmplifyDisclaimer.
- Added a new
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A dialog appears,
A disclaimer to allay fears,
Cloud's privacy kept.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request introduces a new "Prompt Amplifier" feature, which enhances user prompts using an AI assistant. It includes UI elements, resource strings for multiple languages, and logic to manage the feature's availability and display disclaimers. Overall, the changes seem well-structured and address the feature's requirements. However, there are a few areas that could benefit from closer attention.
Summary of Findings
- Default Value for TokensRemaining: The
TokensRemainingproperty inPromptCardViewModelis initialized to -1. While this might indicate an uninitialized state, it's crucial to ensure that the UI handles this value gracefully to avoid any unexpected behavior or display issues. Consider adding a check in the UI to display a placeholder or loading state whenTokensRemainingis -1. - TeachingTip Logic: The logic for displaying the
TeachingTipfor the Prompt Amplifier disclaimer seems a bit complex, involving multiple checks and settings. It might be beneficial to refactor this logic to make it more readable and maintainable, potentially by centralizing the teaching tip display logic in a dedicated method or service. - Resource String Consistency: The resource strings added for the Prompt Amplifier disclaimer are generally well-written and informative. However, it's important to ensure consistency in tone and formatting across all language versions. A review by a localization expert could help ensure that the disclaimers are clear and culturally appropriate in all supported languages.
Merge Readiness
The pull request introduces a significant new feature and appears to be well-structured. However, the identified issues regarding the default value for TokensRemaining and the complexity of the TeachingTip logic should be addressed before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. At a minimum, the high severity comments should be addressed before merging.
| [ObservableProperty] | ||
| [NotifyPropertyChangedFor(nameof(ShowLowTokenWarning), nameof(LowTokenWarningText))] | ||
| private int tokensRemaining; | ||
| private int tokensRemaining = -1; |
There was a problem hiding this comment.
Initializing tokensRemaining to -1 is a good way to indicate that it hasn't been loaded yet. However, ensure the UI handles this -1 value gracefully (e.g., by displaying a loading indicator or a placeholder) to avoid confusion or errors. Consider adding a comment explaining why -1 is used.
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(ShowLowTokenWarning), nameof(LowTokenWarningText)))]
private int tokensRemaining = -1; // -1 indicates tokens haven't been loaded yet| if (!settingsManager.Settings.SeenTeachingTips.Contains(TeachingTip.PromptAmplifyDisclaimer)) | ||
| { | ||
| var dialog = DialogHelper.CreateMarkdownDialog(Resources.PromptAmplifier_Disclaimer); | ||
| dialog.PrimaryButtonText = "Continue"; | ||
| dialog.CloseButtonText = "Back"; | ||
| dialog.IsPrimaryButtonEnabled = true; | ||
| dialog.DefaultButton = ContentDialogButton.Primary; | ||
|
|
||
| var result = await dialog.ShowAsync(); | ||
| if (result == ContentDialogResult.Primary) | ||
| { | ||
| settingsManager.Transaction(settings => | ||
| { | ||
| settings.SeenTeachingTips.Add(TeachingTip.PromptAmplifyDisclaimer); | ||
| }); | ||
| } | ||
| else | ||
| { | ||
| return; | ||
| } | ||
| } |
There was a problem hiding this comment.
This block checks if the disclaimer has been seen and shows a dialog if it hasn't. Consider extracting this logic into a separate method to improve readability and potentially reuse it elsewhere. Also, consider using a more descriptive variable name than dialog.
if (!settingsManager.Settings.SeenTeachingTips.Contains(TeachingTip.PromptAmplifyDisclaimer))
{
await ShowPromptAmplifierDisclaimer();
}
No description provided.