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: Allow strings to be passed for int arguments in TextSearch KernelFunctions #10147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lossyrob
Copy link
Contributor

@lossyrob lossyrob commented Jan 9, 2025

Motivation and Context

The GetArgumentValue method that is called as part of creating KernelFunctions for TextSearch in TestSearchExtensions requires that arguments be passed as integers for "count" and "skip". While using this functionality with a gpt-4o model through Azure OpenAI, the function calls were given arguments that had values encoded as strings. This caused the default count of 2 to always be used, no matter what the LLM was calling for. I noticed this behavior even if I explicitly set the ParameteryType of the KernelParameterMetadata to be int.

Description

This changes the GetArgumentValue method in TextSearchExtensions to allow for integers passed as string values. This will avoid the confusing behavior of the arguments being ignored for TextSearch plugins.

Contribution Checklist

@lossyrob lossyrob requested a review from a team as a code owner January 9, 2025 21:14
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants