Skip to content
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

.Net: Plugin ITextSearch.CreateWithGetSearchResults configurable with TextSearchOptions #10207

Closed
f-bourqui opened this issue Jan 16, 2025 · 3 comments
Assignees
Labels
Build Features planned for next Build conference .NET Issue or Pull requests regarding .NET code text_search

Comments

@f-bourqui
Copy link

f-bourqui commented Jan 16, 2025

I want to create a plugin using CreateWithGetSearchResults on a VectorStoreTextSearch and I'd like to configure the TextSearchOptions.
Unfortunately, it's not available.

public static KernelPlugin CreateWithGetSearchResults(this ITextSearch textSearch, string pluginName, string? description = null)
{
    Verify.NotNull(textSearch);
    Verify.NotNull(pluginName);

    return KernelPluginFactory.CreateFromFunctions(pluginName, description, [textSearch.CreateGetSearchResults()]);
}

I would have expected to have this instead

public static KernelPlugin CreateWithGetSearchResults(this ITextSearch textSearch, string pluginName, string? description = null, TextSearchOptions? searchOptions = null)
{
    Verify.NotNull(textSearch);
    Verify.NotNull(pluginName);

    return KernelPluginFactory.CreateFromFunctions(pluginName, description, [textSearch.CreateGetSearchResults(searchOptions:searchOptions)]);
}

I first thought that it would be configurable while injecting it kernelBuilder.AddVectorStoreTextSearch by providing VectorStoreTextSearchOptions but that class is empty.

Does it make sense to add TextSearchOptions to CreateWithGetSearchResults or is it planned to do it with VectorStoreTextSearchOptions?

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Jan 16, 2025
@github-actions github-actions bot changed the title Plugin ITextSearch.CreateWithGetSearchResults configurable with TextSearchOptions .Net: Plugin ITextSearch.CreateWithGetSearchResults configurable with TextSearchOptions Jan 16, 2025
@markwallace-microsoft markwallace-microsoft self-assigned this Jan 16, 2025
@markwallace-microsoft markwallace-microsoft added the Build Features planned for next Build conference label Jan 16, 2025
@markwallace-microsoft markwallace-microsoft moved this to Sprint: In Progress in Semantic Kernel Jan 16, 2025
@markwallace-microsoft
Copy link
Member

Hi @f-bourqui
you can skip the extension method and instead do this:

var plugin = KernelPluginFactory.CreateFromFunctions(pluginName, description, [textSearch.CreateGetSearchResults(searchOptions: yourSearchOptions)]);

@markwallace-microsoft markwallace-microsoft moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernel Jan 22, 2025
@f-bourqui
Copy link
Author

Yes, I did my own extension to it. By this issue, I also wanted to understand the intent of VectorStoreTextSearchOptions vs TextSearchOptions since one is empty.

@markwallace-microsoft
Copy link
Member

So VectorStoreTextSearchOptions was added to the API as a placeholder for additional options. It is currently experimental so we may remove it if we don't find a use for it.

@markwallace-microsoft markwallace-microsoft moved this from Sprint: In Review to Sprint: Done in Semantic Kernel Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Features planned for next Build conference .NET Issue or Pull requests regarding .NET code text_search
Projects
Status: Sprint: Done
Development

No branches or pull requests

2 participants