Bug: The function call plugin name printed is empty
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
Bắt đầu với kernel.Plugins.AddFromObject(plugin1, pluginName: "time") và Microsoft.SemanticKernel.FunctionCallContent.GetFunctionCalls(response), tái hiện ví dụ chat completion Ollama được cung cấp. Được xem là hoàn tất khi function call kết quả hiển thị tên plugin đã đăng ký, "time", đồng thời FunctionName và invocation tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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);
}
}
- Ngôn ngữ chính
- C#
- Star
- 28.8k
- Fork
- 4.9k
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 48
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/semantic-kernel
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentCó thể đã có người làm @halcyon-past đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
microsoft/semantic-kernel#14824 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Python: Bug: Redis search returns None for every field that declares a storage_name, because RETURN lists the declared nameCó thể đã có người làm @wasim-builds đã nhận 9 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/semantic-kernel#14753 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Có thể đã có người làm @nightcityblade đã nhận 46 ngày trước. Đang mở.NET triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/semantic-kernel#14526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Có thể đã có người làm @VANDRANKI đã nhận 48 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/semantic-kernel#14522 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URICó thể đã có người làm @Laurianti đã nhận 48 ngày trước. Đang mở.NET triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/semantic-kernel#14518 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của microsoft/semantic-kernel
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Support Flux ignore rules (drift detection ignore paths) in Microsoft.KubernetesConfiguration schemaĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Azure/azure-resource-manager-schemas#3921 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
text-align: justify is ignored in HTML to PDF conversionCó thể đã có người làm @PrzemyslawKlys đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
asyncapi/modelina#2709 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày