feat: 提交

This commit is contained in:
cc
2025-06-20 18:06:33 +08:00
parent f16e1cd7a6
commit 6abcc49ed4
15 changed files with 138 additions and 118 deletions

View File

@@ -11,27 +11,5 @@ public class YiFrameworkSemanticKernelModule : AbpModule
{
var configuration = context.Services.GetConfiguration();
var services = context.Services;
// 配置绑定
var semanticKernelSection = configuration.GetSection("SemanticKernel");
services.Configure<SemanticKernelOptions>(configuration.GetSection("SemanticKernel"));
// 从配置中获取值
var options = semanticKernelSection.Get<SemanticKernelOptions>();
foreach (var optionsModelId in options.ModelIds)
{
services.AddKernel()
.AddAzureOpenAIChatCompletion(
deploymentName: optionsModelId,
endpoint: options.Endpoint,
apiKey: options.ApiKey,
serviceId: optionsModelId,
modelId: optionsModelId);
// .AddOpenAIChatCompletion(
// serviceId: optionsModelId,
// modelId: optionsModelId,
// endpoint: new Uri(options.Endpoint),
// apiKey: options.ApiKey);
}
}
}