Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import modelengine.jade.service.annotations.CarverSpan;
import modelengine.jade.service.annotations.SpanAttr;

import java.net.SocketTimeoutException;

/**
* 表示智能体信息获取接口集。
*
Expand Down Expand Up @@ -74,9 +76,12 @@ public Rsp<AgentInfoEntity> generateAgentInfo(HttpClassicServerRequest request,
entity.setTools(
this.agentInfoGenerateService.selectTools(dto.getDescription(), context.getOperator(), context));
} catch (ClientException e) {
// 模型生成内容超时的情况下,提醒用户更换默认模型
log.error("Failed to generate agent infos.", e);
throw new AippException(AippErrCode.GENERATE_CONTENT_FAILED, "agent infos", e.getMessage());
if (e.getCause() != null && e.getCause() instanceof SocketTimeoutException) {
throw new AippException(AippErrCode.MODEL_INVOKE_TIMEOUT);
} else {
throw new AippException(AippErrCode.GENERATE_CONTENT_FAILED, "agent infos", e.getMessage());
}
}
return Rsp.ok(entity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@
90002142=Form not exist.
90002143=No permission to operate this form.
90002144=The app is not in guest mode.
90002145=The large model call timed out. Please try changing the default model.
90003000=The application template does not exist.
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,5 @@
90002142=表单不存在。
90002143=没有权限操作该表单。
90002144=应用未打开游客模式。
90002145=大模型调用超时,请尝试更换默认模型。
90003000=应用模板不存在。
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,11 @@ public enum AippErrCode implements ErrorCode, RetCode {
*/
APP_NOT_IN_GUEST_MODE(90002144, "应用未打开游客模式。"),

/**
* 大模型调用超时。
*/
MODEL_INVOKE_TIMEOUT(90002145, "大模型调用超时,请尝试更换默认模型。"),

/**
* 应用模板不存在。
*/
Expand Down