mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
AI大模型,key调用错误处理
This commit is contained in:
@ -694,7 +694,11 @@ public class AiragChatServiceImpl implements IAiragChatService {
|
||||
HttpServletRequest httpRequest = SpringContextUtils.getHttpServletRequest();
|
||||
TokenStream chatStream;
|
||||
try {
|
||||
chatStream = aiChatHandler.chat(modelId,messages, aiChatParams);
|
||||
if (oConvertUtils.isNotEmpty(modelId)) {
|
||||
chatStream = aiChatHandler.chat(modelId, messages, aiChatParams);
|
||||
} else {
|
||||
chatStream = aiChatHandler.chatByDefaultModel(messages, aiChatParams);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
throw new JeecgBootBizTipException("调用大模型接口失败:" + e.getMessage());
|
||||
|
||||
Reference in New Issue
Block a user