Bug: The function call plugin name printed is empty
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
kernel.Plugins.AddFromObject(plugin1, pluginName: "time") と Microsoft.SemanticKernel.FunctionCallContent.GetFunctionCalls(response) から始め、提供されている Ollama の chat-completion 例を再現します。結果として得られる function call が登録済みの plugin 名 "time" を公開し、FunctionName と invocation が引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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);
}
}
- 主要言語
- C#
- スター
- 28.8k
- フォーク
- 4.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 48
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/semantic-kernel のほかの issue
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContent対応中かも @halcyon-past が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/semantic-kernel#14824 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Python: Bug: Redis search returns None for every field that declares a storage_name, because RETURN lists the declared name対応中かも @wasim-builds が 9 日前に担当しました。 オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoft/semantic-kernel#14753 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23対応中かも @nightcityblade が 46 日前に担当しました。 オープン.NET triage
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
microsoft/semantic-kernel#14526 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)対応中かも @VANDRANKI が 48 日前に担当しました。 オープンpython triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/semantic-kernel#14522 ·
メンテナーはふだん 3 日以内に返信
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URI対応中かも @Laurianti が 48 日前に担当しました。 オープン.NET triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/semantic-kernel#14518 ·
メンテナーはふだん 3 日以内に返信
microsoft/semantic-kernel の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Support Flux ignore rules (drift detection ignore paths) in Microsoft.KubernetesConfiguration schemaオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Azure/azure-resource-manager-schemas#3921 ·
メンテナーはふだん 1 日以内に返信
-
text-align: justify is ignored in HTML to PDF conversion対応中かも @PrzemyslawKlys が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
asyncapi/modelina#2709 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信