fix: 仅获取已启用的聊天模型

在获取聊天模型列表时新增 IsEnabled 条件过滤,避免返回未启用的模型,确保模型选择结果正确。
This commit is contained in:
ccnetcore
2026-01-05 22:19:23 +08:00
parent 5157eac35c
commit 6053899516

View File

@@ -94,6 +94,7 @@ public class AiChatService : ApplicationService
public async Task<List<ModelGetListOutput>> GetModelAsync() public async Task<List<ModelGetListOutput>> GetModelAsync()
{ {
var output = await _aiModelRepository._DbQueryable var output = await _aiModelRepository._DbQueryable
.Where(x=>x.IsEnabled==true)
.Where(x => x.ModelType == ModelTypeEnum.Chat) .Where(x => x.ModelType == ModelTypeEnum.Chat)
.Where(x => x.ModelApiType == ModelApiTypeEnum.OpenAi) .Where(x => x.ModelApiType == ModelApiTypeEnum.OpenAi)
.OrderByDescending(x => x.OrderNum) .OrderByDescending(x => x.OrderNum)