Bug: The function call plugin name printed is empty
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
Línea de trabajo
Comienza con kernel.Plugins.AddFromObject(plugin1, pluginName: "time") y Microsoft.SemanticKernel.FunctionCallContent.GetFunctionCalls(response), reproduciendo el ejemplo proporcionado de chat completion de Ollama. Se considera terminado cuando la llamada de función resultante expone el nombre del plugin registrado, "time", y FunctionName y la invocación siguen funcionando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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);
}
}
- Lenguaje dominante
- C#
- Estrellas
- 28.8k
- Forks
- 4.9k
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 48
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/semantic-kernel
-
Python: Bug: ChatMessageContent.from_element drops AudioContent and BinaryContent into raw TextContentPosiblemente ocupada @halcyon-past la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/semantic-kernel#14824 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Python: Bug: Redis search returns None for every field that declares a storage_name, because RETURN lists the declared namePosiblemente ocupada @wasim-builds la tomó hace 9 días. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/semantic-kernel#14753 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Posiblemente ocupada @nightcityblade la tomó hace 46 días. Abierto.NET triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
microsoft/semantic-kernel#14526 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Posiblemente ocupada @VANDRANKI la tomó hace 48 días. Abiertopython triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/semantic-kernel#14522 ·
Los mantenedores suelen responder en 3 días
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URIPosiblemente ocupada @Laurianti la tomó hace 48 días. Abierto.NET triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
microsoft/semantic-kernel#14518 ·
Los mantenedores suelen responder en 3 días
Todos los issues de microsoft/semantic-kernel
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Support Flux ignore rules (drift detection ignore paths) in Microsoft.KubernetesConfiguration schemaAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Azure/azure-resource-manager-schemas#3921 ·
Los mantenedores suelen responder en 1 día
-
text-align: justify is ignored in HTML to PDF conversionPosiblemente ocupada @PrzemyslawKlys la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
asyncapi/modelina#2709 · 1 comentario ·
Los mantenedores suelen responder en 1 día