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: Fix 5796 function calling enum params #5998
Merged
RogerBarreto
merged 14 commits into
microsoft:main
from
Krzysztof318:fix-5796-function-calling-enum-param-exception
May 13, 2024
Merged
.Net: Fix 5796 function calling enum params #5998
RogerBarreto
merged 14 commits into
microsoft:main
from
Krzysztof318:fix-5796-function-calling-enum-param-exception
May 13, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nnector in the `GeminiFunctionCallingTests.cs` file. These tests verify that the interface can correctly handle enum parameters when using the `TimePlugin`.
markwallace-microsoft
added
.NET
Issue or Pull requests regarding .NET code
kernel
Issues or pull requests impacting the core kernel
labels
Apr 24, 2024
github-actions
bot
changed the title
Fix 5796 function calling enum params
.Net: Fix 5796 function calling enum params
Apr 24, 2024
The previous code handled a specific case for string enum converter values where it would assign a JsonSchemaType without assigning the format. This has been simplified by defaulting schemaType to JsonSchemaType.String, and assigning the format to "enum" when values are present. This change ensures that the schema type assignment is more straightforward and consistent.
New test `CanAutoInvokeKernelFunctionsWithEnumTypeParametersAsync` is added to OpenAI tool tests. This test uses the added TimePlugin to ask about last Friday's date. TimePlugin is designed to match the last day given a week day name, using a provided TimeProvider and format.
…ram-exception # Conflicts: # dotnet/src/IntegrationTests/Connectors/OpenAI/OpenAIToolsTests.cs
SergeyMenshykh
approved these changes
Apr 26, 2024
@Krzysztof318 could you take a look at the build error? Thanks. |
@markwallace-microsoft until 19.05 I am out of office |
RogerBarreto
approved these changes
May 13, 2024
…into fix-5796-function-calling-enum-param-exception
markwallace-microsoft
approved these changes
May 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Fixes #5796
Description
Type for enum wasn't correctly set in JsonSchemaMapper, it didn't matter for OpenAI but gemini was throwing exception if type isn't specified. Fixed that with
string
type.Added new unit tests for Gemini and OpenAI. Both passed.
@RogerBarreto
@SergeyMenshykh
DataHelper and BertOnyx was updated automatically by formatter.
Contribution Checklist