Bug: The function call plugin name printed is empty
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start with kernel.Plugins.AddFromObject(plugin1, pluginName: "time") and Microsoft.SemanticKernel.FunctionCallContent.GetFunctionCalls(response), reproducing the supplied Ollama chat-completion example. Done means the resulting function call exposes the registered plugin name, "time", while FunctionName and invocation continue to work.
Written by the indexing model from the issue text.
Description
The function call plugin name printed is empty
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.Ollama;
using System.ComponentModel;
using System.Text;
#pragma warning disable SKEXP0110
public class TimePlugin
{
[KernelFunction, Description("读取指定路径文件的内容,跨平台兼容~目录")]
public string ReadFile(
string filePath)
{
var ret = File.ReadAllText(filePath, Encoding.UTF8);
return ret;
}
[KernelFunction, Description("This method is used to query the current system time and return it in the format yyyy-MM-dd HH:mm:ss")]
public string QueryDateTime()
{
return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}
[KernelFunction, Description("The purpose of this method is to write the text content to the local computer's target path")]
public void SaveFile(string filePath, string fileContent)
{
System.IO.File.WriteAllText(filePath, fileContent);
}
}
class Program3
{
public static async Task Main()
{
Console.OutputEncoding = System.Text.Encoding.UTF8;
var builder = Kernel.CreateBuilder();
var modelId = "qwen3:4b-instruct-2507-q4_K_M";
var endpoint = new Uri("http://localhost:11434");
builder.Services.AddOllamaChatCompletion(modelId, endpoint);
var kernel = builder.Build();
//KernelPlugin plugin = kernel.ImportPluginFromType<TimePlugin>();
var plugin1 = new TimePlugin();
kernel.Plugins.AddFromObject(plugin1, pluginName:"time");
var chatCompletionService = kernel.GetRequiredService<IChatCompletionService>();
string prompt = "读取一下d:\\test123.txt的内容";
var executionSettings = new OllamaPromptExecutionSettings
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(autoInvoke: false)
};
var t0 = DateTime.Now;
var response = await chatCompletionService.GetChatMessageContentAsync(prompt, kernel: kernel, executionSettings: executionSettings);
var functionCalls = Microsoft.SemanticKernel.FunctionCallContent.GetFunctionCalls(response).ToArray();
foreach (var functionCall in functionCalls)
{
Console.WriteLine($" {functionCall.PluginName}, {functionCall.FunctionName}");//error have no PluginName
var functionResult = await functionCall.InvokeAsync(kernel);
Console.WriteLine($"{functionResult.Result}");
}
Console.WriteLine($"工具调用数 {functionCalls.Length}");
Console.Write(response.Content);
}
}
- Dominant language
- C#
- Stars
- 28.8k
- Forks
- 4.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 48
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from microsoft/semantic-kernel
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPossibly taken @halcyon-past claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/semantic-kernel#14824 · 1 comment ·
Maintainers usually reply within 3 days
-
Python: Bug: Redis search returns None for every field that declares a storage_name, because RETURN lists the declared namePossibly taken @wasim-builds claimed this 9 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/semantic-kernel#14753 · 1 comment ·
Maintainers usually reply within 3 days
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Possibly taken @nightcityblade claimed this 46 days ago. Open.NET triage
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
microsoft/semantic-kernel#14526 · 1 comment ·
Maintainers usually reply within 3 days
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Possibly taken @VANDRANKI claimed this 48 days ago. Openpython triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/semantic-kernel#14522 ·
Maintainers usually reply within 3 days
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URIPossibly taken @Laurianti claimed this 48 days ago. Open.NET triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
microsoft/semantic-kernel#14518 ·
Maintainers usually reply within 3 days
All issues in microsoft/semantic-kernel
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Support Flux ignore rules (drift detection ignore paths) in Microsoft.KubernetesConfiguration schemaOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Azure/azure-resource-manager-schemas#3921 ·
Maintainers usually reply within 1 day
-
text-align: justify is ignored in HTML to PDF conversionPossibly taken @PrzemyslawKlys claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
asyncapi/modelina#2709 · 1 comment ·
Maintainers usually reply within 1 day