diff --git a/src/AntSK.Domain/AntSK.Domain.csproj b/src/AntSK.Domain/AntSK.Domain.csproj index a5118e1d..27173e62 100644 --- a/src/AntSK.Domain/AntSK.Domain.csproj +++ b/src/AntSK.Domain/AntSK.Domain.csproj @@ -51,7 +51,7 @@ - + diff --git a/src/AntSK.Domain/Common/AntSkFunctionAttribute.cs b/src/AntSK.Domain/Common/AntSkFunctionAttribute.cs index 767e16fe..4ba28262 100644 --- a/src/AntSK.Domain/Common/AntSkFunctionAttribute.cs +++ b/src/AntSK.Domain/Common/AntSkFunctionAttribute.cs @@ -1,7 +1,7 @@ namespace AntSK.Domain.Common { [AttributeUsage(AttributeTargets.Method)] - public class AntSkFunctionAttribute : Attribute + public class AntSKFunctionAttribute : Attribute { // 自定义的ActionAttribute } diff --git a/src/AntSK.Domain/Domain/Service/KernelService.cs b/src/AntSK.Domain/Domain/Service/KernelService.cs index 6a35d474..b50837c6 100644 --- a/src/AntSK.Domain/Domain/Service/KernelService.cs +++ b/src/AntSK.Domain/Domain/Service/KernelService.cs @@ -176,7 +176,7 @@ private void WithTextGenerationByAIType(IKernelBuilder builder,AIModels chatMode public void ImportFunctionsByApp(Apps app, Kernel _kernel) { //插件不能重复注册,否则会异常 - if (_kernel.Plugins.Any(p => p.Name == "AntSkFunctions")) + if (_kernel.Plugins.Any(p => p.Name == "AntSKFunctions")) { return; } @@ -187,7 +187,7 @@ public void ImportFunctionsByApp(Apps app, Kernel _kernel) //本地函数插件 ImportNativeFunction(app, functions); - _kernel.ImportPluginFromFunctions("AntSkFunctions", functions); + _kernel.ImportPluginFromFunctions("AntSKFunctions", functions); } /// diff --git a/src/AntSK.LLM/SparkDesk/SparkDeskChatCompletion.cs b/src/AntSK.LLM/SparkDesk/SparkDeskChatCompletion.cs index a8f4a625..d67efa51 100644 --- a/src/AntSK.LLM/SparkDesk/SparkDeskChatCompletion.cs +++ b/src/AntSK.LLM/SparkDesk/SparkDeskChatCompletion.cs @@ -50,7 +50,7 @@ public async Task> GetChatMessageContentsAsync parameters.Temperature = (float)chatExecutionSettings.Temperature; parameters.MaxTokens = chatExecutionSettings.MaxTokens ?? parameters.MaxTokens; - IList functions = kernel?.Plugins.GetFunctionsMetadata().Where(x => x.PluginName == "AntSkFunctions").ToList() ?? []; + IList functions = kernel?.Plugins.GetFunctionsMetadata().Where(x => x.PluginName == "AntSKFunctions").ToList() ?? []; var functionDefs = functions.Select(func => new FunctionDef(func.Name, func.Description, func.Parameters.Select(p => new FunctionParametersDef(p.Name, p.ParameterType?.IsClass == true ? "object" : "string", p.Description, p.IsRequired)).ToList())).ToList(); List messages = GetSparkMessage(chatHistory); @@ -133,7 +133,7 @@ public async IAsyncEnumerable GetStreamingChatMessa parameters.Temperature = (float)chatExecutionSettings.Temperature; parameters.MaxTokens = chatExecutionSettings.MaxTokens ?? parameters.MaxTokens; - IList functions = kernel?.Plugins.GetFunctionsMetadata().Where(x => x.PluginName == "AntSkFunctions").ToList() ?? []; + IList functions = kernel?.Plugins.GetFunctionsMetadata().Where(x => x.PluginName == "AntSKFunctions").ToList() ?? []; var functionDefs = functions.Select(func => new FunctionDef(func.Name, func.Description, func.Parameters.Select(p => new FunctionParametersDef(p.Name, p.ParameterType?.IsClass == true ? "object" : "string", p.Description, p.IsRequired)).ToList())).ToList(); List messages = GetSparkMessage(chatHistory); await foreach (StreamedChatResponse msg in _client.ChatAsStreamAsync(_options.ModelVersion, messages.ToArray(), parameters, functionDefs.Count > 0 ? [.. functionDefs] : null, cancellationToken: cancellationToken)) diff --git a/src/AntSK.LLM/SparkDesk/SparkDeskTextCompletion.cs b/src/AntSK.LLM/SparkDesk/SparkDeskTextCompletion.cs index e2ec0513..c72da3e0 100644 --- a/src/AntSK.LLM/SparkDesk/SparkDeskTextCompletion.cs +++ b/src/AntSK.LLM/SparkDesk/SparkDeskTextCompletion.cs @@ -67,7 +67,7 @@ public IAsyncEnumerable GetStreamingTextContentsAsync(stri parameters.Temperature = (float)chatExecutionSettings.Temperature; parameters.MaxTokens = chatExecutionSettings.MaxTokens ?? parameters.MaxTokens; - IList functions = kernel?.Plugins.GetFunctionsMetadata().Where(x => x.PluginName == "AntSkFunctions").ToList() ?? []; + IList functions = kernel?.Plugins.GetFunctionsMetadata().Where(x => x.PluginName == "AntSKFunctions").ToList() ?? []; var functionDefs = functions.Select(func => new FunctionDef(func.Name, func.Description, func.Parameters.Select(p => new FunctionParametersDef(p.Name, p.ParameterType?.IsClass == true ? "object" : "string", p.Description, p.IsRequired)).ToList())).ToList(); //var messages = GetHistories(prompt);