-
Notifications
You must be signed in to change notification settings - Fork 314
De-duplicate prediction results with the history results #3543
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
/cc @StevenBucher98: this is for the de-duplication work item. It could be great if we can verify the new user experience with Az predictor (if we can reproduce the issue in Az predictor). |
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.
LGTM, awesome work Dongbo!
Verified previous duplications with Az Predictor are no longer there on this branch
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.
Looks great, thanks Dongbo!
// NOTE: when any duplicate results were skipped, the 'count' passed in here won't be accurate as it still includes | ||
// those skipped ones. This is due to the limitation of the 'OnSuggestionDisplayed' interface method, which didn't | ||
// assume any prediction results from a predictor could be filtered out at the initial design time. We will have to | ||
// change the predictor interface to pass in accurate information, such as: | ||
// void OnSuggestionDisplayed(Guid predictorId, uint session, int countOrIndex, int[] skippedIndices) | ||
// | ||
// However, an interface change has huge impacts. At least, a newer version of PSReadLine will stop working on the | ||
// existing PowerShell 7+ versions. For this particular issue, the chance that it could happen is low and the impact | ||
// of the inaccurate feedback is also low, so we should delay this interface change until another highly-demanded | ||
// change to the interface is required in future (e.g. changes related to supporting OpenAI models). |
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.
Thanks for the detailed note 👍
Thank you both for the reivew! |
🎉 |
PR Summary
De-duplicate prediction results with the history results.
A prediction result could be the same as the one found in history. This happens sometimes to the Az predictor.
When used in list view, it's confusing for the user to see 2 same results in the list, both from history and a predictor. So, we de-duplicate the prediction results against the history results.
For now, we only remove the prediction results that are exactly the same (case-sensitive or case-insensitive decided by the user with the 'HistorySearchCaseSensitive' setting, which is
false
by default) as one of the history results.PR Checklist
Microsoft Reviewers: Open in CodeFlow