feat: 重构聊天室语义内核
This commit is contained in:
@@ -2,7 +2,7 @@ namespace Yi.Framework.Stock.Domain.Managers.SemanticKernel
|
||||
{
|
||||
public class SemanticKernelOptions
|
||||
{
|
||||
public string ModelId { get; set; }
|
||||
public List<string> ModelIds { get; set; }
|
||||
public string Endpoint { get; set; }
|
||||
public string ApiKey { get; set; }
|
||||
}
|
||||
|
||||
@@ -32,9 +32,10 @@ namespace Yi.Framework.Stock.Domain
|
||||
#pragma warning disable SKEXP0010
|
||||
// 从配置中获取值
|
||||
var options = semanticKernelSection.Get<SemanticKernelOptions>();
|
||||
//股市优先使用第一个ai模型
|
||||
services.AddKernel()
|
||||
.AddOpenAIChatCompletion(
|
||||
modelId: options.ModelId,
|
||||
modelId: options.ModelIds.FirstOrDefault(),
|
||||
endpoint: new Uri(options.Endpoint),
|
||||
apiKey: options.ApiKey);
|
||||
#pragma warning restore SKEXP0010
|
||||
|
||||
Reference in New Issue
Block a user