.Net: Fix #13516 - Parse plugin name from fully qualified function name in MEAI conversion#14101
Open
Whning0513 wants to merge 1 commit into
Open
.Net: Fix #13516 - Parse plugin name from fully qualified function name in MEAI conversion#14101Whning0513 wants to merge 1 commit into
Whning0513 wants to merge 1 commit into
Conversation
… name in MEAI conversion
|
@Whning0513 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Author
|
@microsoft-github-policy-service agree |
1 similar comment
Author
|
@microsoft-github-policy-service agree |
This file contains hidden or 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
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.
Bug: The function call plugin name printed is empty
When using Ollama with Semantic Kernel and invoking
FunctionChoiceBehavior.Auto, thefunctionCall.PluginNameis empty/blank inFunctionCallContentobjects. This prevents proper identification of which plugin a function belongs to. Users must rely on the function name alone for routing, which is ambiguous when multiple plugins have functions with the same name.Reported by: Community user
The
ChatMessageExtensions.ToChatMessageContent()method in the MEAI (Microsoft.Extensions.AI) conversion layer was convertingFunctionCallContentfrom MEAI format to Semantic Kernel format without parsing the plugin name from the fully qualified function name. The MEAI convention uses an underscore-separated format (plugin_function) but the conversion code was passingnullas the plugin name.File:
dotnet/src/InternalUtilities/meai/Extensions/ChatMessageExtensions.csGetFunctionName()static method that parses the plugin name from the underscore-separated MEAI function name formatpluginNameand the portion after as thefunctionNamepluginNameis set tonull(backward compatible)GetFunctionName()into theFunctionCallContentconstructor call to populate thepluginNameparameterLow - The change adds plugin name parsing logic that populates a field that was previously
null. If the MEAI function name doesn't follow theplugin_functionconvention, the plugin name remainsnull(no behavior change). For names that do follow the convention, the correct plugin name is now available.