Skip to content

Commit b6b9580

Browse files
fix: 额度耗尽的错误提示
1 parent aa7ae88 commit b6b9580

File tree

2 files changed

+12
-2
lines changed
  • apps/miniprogram-agent-ui/miniprogram/components/agent-ui
  • components/agent-ui

2 files changed

+12
-2
lines changed

apps/miniprogram-agent-ui/miniprogram/components/agent-ui/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,12 @@ Component({
14251425
lastValue.knowledge_meta = [];
14261426
lastValue.content = this.data.defaultErrorMsg;
14271427
if (error && error.message) {
1428-
lastValue.error = error.message;
1428+
if (error.code === "EXCEED_TOKEN_QUOTA_LIMIT") {
1429+
lastValue.content = "大模型 Token 已耗尽,请通知开发者前往云开发平台进行处理";
1430+
lastValue.error = lastValue.content;
1431+
} else {
1432+
lastValue.content = error.message;
1433+
}
14291434
this.setData({
14301435
[`chatRecords[${lastValueIndex}].error`]: lastValue.error,
14311436
});

components/agent-ui/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,12 @@ Component({
14251425
lastValue.knowledge_meta = [];
14261426
lastValue.content = this.data.defaultErrorMsg;
14271427
if (error && error.message) {
1428-
lastValue.error = error.message;
1428+
if (error.code === "EXCEED_TOKEN_QUOTA_LIMIT") {
1429+
lastValue.content = "大模型 Token 已耗尽,请通知开发者前往云开发平台进行处理";
1430+
lastValue.error = lastValue.content;
1431+
} else {
1432+
lastValue.content = error.message;
1433+
}
14291434
this.setData({
14301435
[`chatRecords[${lastValueIndex}].error`]: lastValue.error,
14311436
});

0 commit comments

Comments
 (0)