-
Notifications
You must be signed in to change notification settings - Fork 4k
.Net: Change the return type of ITextSearch to align with search abstractions in M.E.VD #11782
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
base: main
Are you sure you want to change the base?
Conversation
…- Phase 1 (#11519) ### Motivation and Context 1. Change the return type of ITextSearch to align with search abstractions in M.E.VD 2. Make `top` a required parameter to align with search abstractions in M.E.VD ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
### Motivation and Context 1. Update BraveTextSearch to use latest `ITextSearch` 2. Add integration tests ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
9bfab25
to
b45637a
Compare
b45637a
to
3d1f86f
Compare
/// <returns>A <see cref="KernelPlugin"/> instance with a Search operation that calls the provided <see cref="ITextSearch.SearchAsync(string, TextSearchOptions?, CancellationToken)"/>.</returns> | ||
[RequiresUnreferencedCode("Uses reflection to handle various aspects of the function creation and invocation, making it incompatible with AOT scenarios.")] | ||
[RequiresDynamicCode("Uses reflection to handle various aspects of the function creation and invocation, making it incompatible with AOT scenarios.")] | ||
public static KernelPlugin CreateWithSearch(this ITextSearch textSearch, int top, string pluginName, string? description = null) |
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.
I've been struggling with these names, since they don't actually tell you what it's creating.
Since you call it on textsearch, it sounds like it's creating a textsearch, but that doesn't really make sense since you already have a textsearch instance.
The different overloads also don't really clearly tell me what I'm going to get. I always need to go and look at the code to try and figure out if I'm going to get back a string only or one of the other types.
Since we are introducing new methods this may be a good opportunity to revisit the naming.
An alternative naming scheme:
ToSearchPlugin
ToCitationSearchPlugin
ToProviderSearchPlugin
Motivation and Context
Description
Contribution Checklist