Skip to content

Commit a249866

Browse files
committed
feat: support agent uploadfile config
1 parent d232dfd commit a249866

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Component({
169169
bot,
170170
questions,
171171
chatRecords: [...chatRecords, record],
172-
showWebSearchSwitch: !!(bot.searchEnable && allowWebSearch),
172+
showWebSearchSwitch: allowWebSearch,
173173
showUploadFile: allowUploadFile,
174174
showPullRefresh: allowPullRefresh,
175175
});
@@ -573,6 +573,14 @@ Component({
573573
});
574574
},
575575
handleUploadMessageFile: function () {
576+
// 判断agent 配置是否打开上传文件
577+
if(!this.data.bot.searchFileEnable) {
578+
wx.showModal({
579+
title: "提示",
580+
content: "请前往腾讯云开发平台启用 Agent 文件上传功能",
581+
});
582+
return;
583+
}
576584
if (this.data.useWebSearch) {
577585
wx.showModal({
578586
title: "提示",
@@ -1030,6 +1038,13 @@ Component({
10301038
});
10311039
},
10321040
handleClickWebSearch: function () {
1041+
if(!this.data.useWebSearch && !this.data.bot.searchEnable) {
1042+
wx.showModal({
1043+
title: "提示",
1044+
content: "请前往腾讯云开发平台启用 Agent 联网搜索功能",
1045+
});
1046+
return;
1047+
}
10331048
if (this.data.sendFileList.length) {
10341049
wx.showModal({
10351050
title: "提示",

apps/miniprogram-agent-ui/project.private.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
},
66
"condition": {},
77
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
8-
"projectname": "miniprogram-1",
8+
"projectname": "cloudbase-agent-ui",
99
"libVersion": "3.7.8"
1010
}

0 commit comments

Comments
 (0)