Skip to content

Commit d7006a2

Browse files
Mrjingovo-zhou
authored andcommitted
feat: support agent uploadfile config
1 parent 75300e8 commit d7006a2

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: "提示",
@@ -1031,6 +1039,13 @@ Component({
10311039
});
10321040
},
10331041
handleClickWebSearch: function () {
1042+
if(!this.data.useWebSearch && !this.data.bot.searchEnable) {
1043+
wx.showModal({
1044+
title: "提示",
1045+
content: "请前往腾讯云开发平台启用 Agent 联网搜索功能",
1046+
});
1047+
return;
1048+
}
10341049
if (this.data.sendFileList.length) {
10351050
wx.showModal({
10361051
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)