microsoft / microsoft/semantic-kernel
.Net: OpenAIFunction NameSeparator defaults to a dash causing function calling inconsistencies with gemini models
@SergeyMenshykh is already working on this.
Since Apr 14, 2025.
- Dominant language
- C#
- Stars
- 28.6k
- Forks
- 4.8k
- Avg merge
- 14h 13m
- Merged PRs (30d)
- 18
Description
I am using the OpenAIChatCompletionService of Semantic Kernel together with Litellm to make requests to different model providers.
However, the name separator between the name of the plugin and the function for OpenAI defaults to "-":
internal OpenAIFunction(
string? pluginName,
string functionName,
string? description,
IReadOnlyList<OpenAIFunctionParameter>? parameters,
OpenAIFunctionReturnParameter? returnParameter)
{
Verify.NotNullOrWhiteSpace(functionName);
this.PluginName = pluginName;
this.FunctionName = functionName;
this.Description = description;
this.Parameters = parameters;
this.ReturnParameter = returnParameter;
}
/// <summary>Gets the separator used between the plugin name and the function name, if a plugin name is present.</summary>
/// <remarks>This separator was previously <c>_</c>, but has been changed to <c>-</c> to better align to the behavior elsewhere in SK and in response
/// to developers who want to use underscores in their function or plugin names. We plan to make this setting configurable in the future.</remarks>
public static string NameSeparator { get; set; } = "-";
The dash causes inconsistencies in the function calling capabilities of gemini models. Gemini often does not call the functions and instead responses directly asking for more information.
I have seen that the default for KernelAIFunctions has been changed to an underscore again: #10815.
Is it also possible to have it as standard for OpenAIFunctions? Or do you know any workarounds to set the default separator?
Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.