Merge pull request #181 from LM20230311/feat-model-priority

解决问答实现类中重新查询模型逻辑可能导致自动选择的模型被重置问题
This commit is contained in:
evo
2025-09-27 19:07:34 +08:00
committed by GitHub

View File

@@ -118,7 +118,7 @@ public class ImageServiceImpl implements IChatService {
@Override
public SseEmitter chat(ChatRequest chatRequest, SseEmitter emitter) {
// 从数据库获取 image 类型的模型配置
ChatModelVo chatModelVo = chatModelService.selectModelByCategory(ChatModeType.IMAGE.getCode());
ChatModelVo chatModelVo = chatModelService.selectModelByName(chatRequest.getModel());
if (chatModelVo == null) {
log.error("未找到 image 类型的模型配置");
emitter.completeWithError(new IllegalStateException("未找到 image 类型的模型配置"));