mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-04-16 21:33:40 +00:00
feat: 不选择模型自动选择时走原始默认逻辑;
This commit is contained in:
@@ -125,7 +125,8 @@ public class SseServiceImpl implements ISseService {
|
||||
// 自动选择模型并获取对应的聊天服务
|
||||
IChatService chatService = autoSelectModelAndGetService(chatRequest);
|
||||
|
||||
// 统一重试与降级:封装启动逻辑,并通过ThreadLocal传递失败回调
|
||||
// 仅当 autoSelectModel = true 时,才启用重试与降级
|
||||
if (Boolean.TRUE.equals(chatRequest.getAutoSelectModel())) {
|
||||
ChatModelVo currentModel = this.chatModelVo;
|
||||
String currentCategory = currentModel.getCategory();
|
||||
ChatRetryHelper.executeWithRetry(
|
||||
@@ -145,6 +146,10 @@ public class SseServiceImpl implements ISseService {
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
// 不重试不降级,直接调用
|
||||
chatService.chat(chatRequest, sseEmitter);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
SSEUtil.sendErrorEvent(sseEmitter,e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user