-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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: Add JsonElement String to Primitive Implicit Conversion Support (SLM Function Calling) #9784
Merged
RogerBarreto
merged 14 commits into
microsoft:main
from
RogerBarreto:issues/9711-ollama-jsonelement-fc
Nov 22, 2024
Merged
.Net: Add JsonElement String to Primitive Implicit Conversion Support (SLM Function Calling) #9784
RogerBarreto
merged 14 commits into
microsoft:main
from
RogerBarreto:issues/9711-ollama-jsonelement-fc
Nov 22, 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
markwallace-microsoft
added
.NET
Issue or Pull requests regarding .NET code
kernel
Issues or pull requests impacting the core kernel
kernel.core
labels
Nov 21, 2024
RogerBarreto
had a problem deploying
to
integration
November 21, 2024 16:56
— with
GitHub Actions
Error
RogerBarreto
temporarily deployed
to
integration
November 21, 2024 17:05
— with
GitHub Actions
Inactive
RogerBarreto
had a problem deploying
to
integration
November 21, 2024 17:14
— with
GitHub Actions
Error
RogerBarreto
temporarily deployed
to
integration
November 21, 2024 17:22
— with
GitHub Actions
Inactive
RogerBarreto
changed the title
.Net: Add advanced support for conversion of JsonElement as arguments
.Net: Add JsonElement String to Primitive Implicit Conversion Support (SLM Function Calling)
Nov 21, 2024
dmytrostruk
reviewed
Nov 21, 2024
dotnet/samples/Demos/OllamaFunctionCalling/Plugins/TodoPlugin.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/Demos/OllamaFunctionCalling/Plugins/TodoPlugin.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/Demos/OllamaFunctionCalling/Plugins/TodoPlugin.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.UnitTests/Functions/KernelFunctionFromMethodTests1.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.UnitTests/Functions/KernelFunctionFromMethodTests1.cs
Outdated
Show resolved
Hide resolved
RogerBarreto
had a problem deploying
to
integration
November 21, 2024 17:37
— with
GitHub Actions
Error
RogerBarreto
had a problem deploying
to
integration
November 21, 2024 17:39
— with
GitHub Actions
Error
…omMethodTests1.cs Co-authored-by: Dmytro Struk <[email protected]>
…omMethodTests1.cs Co-authored-by: Dmytro Struk <[email protected]>
RogerBarreto
temporarily deployed
to
integration
November 21, 2024 17:42
— with
GitHub Actions
Inactive
dmytrostruk
approved these changes
Nov 21, 2024
markwallace-microsoft
approved these changes
Nov 22, 2024
This reverts commit 5bf25cd.
RogerBarreto
temporarily deployed
to
integration
November 22, 2024 10:39
— with
GitHub Actions
Inactive
dotnet/src/SemanticKernel.Core/Functions/KernelFunctionFromMethod.cs
Outdated
Show resolved
Hide resolved
RogerBarreto
had a problem deploying
to
integration
November 22, 2024 11:51
— with
GitHub Actions
Error
RogerBarreto
temporarily deployed
to
integration
November 22, 2024 11:52
— with
GitHub Actions
Inactive
SergeyMenshykh
approved these changes
Nov 22, 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
In the original logic the conversion was giving priority for existence of converters when the parameter value was a JsonElement/JsonDocument/JsonNode, this change checks if the argument is one of those types first and use the proper JSON conversion.
This change also bring some resiliency when the
JsonElement
provided is astring
for primitive types likeboolean
and C# numeric types.This change improves function calling experience when using local models that send JSON string argument values ("1" or "true") instead of the expected JSON type (1, true) for calling functions.
i.e:
Llama 3.1, Llama 3.2
Added Unit Tests covering the added JsonElement arguments support.