Skip to content

Commit 2945966

Browse files
authored
Merge pull request #43 from TencentCloudBase/dev
Dev
2 parents 465b3e7 + eee3716 commit 2945966

File tree

20 files changed

+1283
-266
lines changed

20 files changed

+1283
-266
lines changed

CHANGELOG.md

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,18 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5-
### [1.8.2](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.8.1...v1.8.2) (2025-04-09)
5+
## 1.9.0 (2025-04-18)
6+
7+
### Features
8+
9+
* 支持多会话
10+
11+
### Bug Fixes
12+
13+
* 修复系统提示语在切会话时插入位置bug ([7c3e77a](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/7c3e77a2b13b5a33c18e0821fc4eb23937ebdfd5))
14+
* 支持request 域名校验 ([5c21561](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/5c21561ffc06523bbcb7fcb3b91b17f492ab4b8f))
615

16+
### [1.8.2](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.8.1...v1.8.2) (2025-04-09)
717

818
### Bug Fixes
919

@@ -13,7 +23,6 @@ All notable changes to this project will be documented in this file. See [standa
1323

1424
### [1.8.1](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.8.0...v1.8.1) (2025-04-08)
1525

16-
1726
### Bug Fixes
1827

1928
* 3.8.1版本切换兼容 ([190a59f](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/190a59f87d3323cb971b7627eb1806e6493651d6))
@@ -25,15 +34,13 @@ All notable changes to this project will be documented in this file. See [standa
2534

2635
## [1.8.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.7.0...v1.8.0) (2025-03-31)
2736

28-
2937
### Features
3038

3139
* 环境共享迁移完成 ([16f48cb](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/16f48cbbf96b6d8ea9ae0eee4c7b6b374af330df))
3240
* 添加环境共享 ([48d5180](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/48d51801417a485836652401ba79fabea94a23d2))
3341
* 添加环境共享参数 ([0946290](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/0946290c6e3c90acdd93776556f1544f3a52fde6))
3442
* support mcp ([f6b6663](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/f6b66636135d84a77dfa48ddf2c03ec7f8388491))
3543

36-
3744
### Bug Fixes
3845

3946
* 继续优化scroll-view 高度设置 ([b520964](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/b520964192f15c70715bc07850f54fb59453857c))
@@ -47,7 +54,6 @@ All notable changes to this project will be documented in this file. See [standa
4754

4855
## [1.7.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.6.0...v1.7.0) (2025-03-21)
4956

50-
5157
### Features
5258

5359
* 添加复制 ([69c4aad](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/69c4aad44de2994aadeaff20cb3c5bd86eeff4bb))
@@ -56,7 +62,6 @@ All notable changes to this project will be documented in this file. See [standa
5662
* 修改文档 ([0e642e5](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/0e642e59139043a592f7b4dd1d0ea406fbb36737))
5763
* support upload img ([f2fcc00](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/f2fcc00cc60c7717dc9035ea1e3a426c050262e0))
5864

59-
6065
### Bug Fixes
6166

6267
* fix readme ([8e959db](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/8e959db57f890765437e6ae6ba48105bbd872964))
@@ -65,37 +70,32 @@ All notable changes to this project will be documented in this file. See [standa
6570

6671
## [1.6.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.8...v1.6.0) (2025-03-18)
6772

68-
6973
### Features
7074

7175
* 修改参数 ([9e2a868](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/9e2a8683716958ba3c0f10d06d0482f854c514b1))
7276
* 支持数据模型检索 ([e2c6da6](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/e2c6da63cf1b4e51185bfdfa1f98f6f1807caab2))
7377
* support agent uploadfile config ([d7006a2](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/d7006a2827489938411ca6e5b5244c8019e85ae7))
7478
* support file in history ([bbe9810](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/bbe9810b6b3c8d68a6a7a7d6549bc7730530cd16))
7579

76-
7780
### Bug Fixes
7881

7982
* 针对企业微信环境判断处理 ([cffabc4](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/cffabc4fccbcbf038eed8659d53920c9c04891a5))
8083
* fix readme ([eb52a49](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/eb52a495ebbeef603776809a443b4b5f10701952))
8184

8285
## [1.5.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.8...v1.5.0) (2025-03-14)
8386

84-
8587
### Features
8688

8789
* 支持数据模型检索 ([be5ed84](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/be5ed8419b9be0ba2284ae5017f2ad35995e8b4e))
8890
* support agent uploadfile config ([a249866](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/a249866aaafe1e744d43c2ccdbd83856c72d1eb2))
8991
* support file in history ([51d3ef0](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/51d3ef0f4cf45bc12a7b62cb1a887e834a948be5))
9092

91-
9293
### Bug Fixes
9394

9495
* fix readme ([42b5830](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/42b5830de3e885a3adf6ab658f785c496158cd5c))
9596

9697
### [1.4.8](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.7...v1.4.8) (2025-03-10)
9798

98-
9999
### Bug Fixes
100100

101101
* change cos upload ([d5709df](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/d5709df55a37b203d82fca95a9388d2d896cd500))
@@ -105,35 +105,30 @@ All notable changes to this project will be documented in this file. See [standa
105105

106106
### [1.4.7](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.6...v1.4.7) (2025-03-10)
107107

108-
109108
### Bug Fixes
110109

111110
* fix workflow ([eaed4f2](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/eaed4f28a10d9eecd4d83c8f25d731442851ab52))
112111

113112
### [1.4.6](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.5...v1.4.6) (2025-03-10)
114113

115-
116114
### Bug Fixes
117115

118116
* fix workflow ([a526943](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/a5269433be9a3106255bb19b5a6d2ea329ec33f5))
119117

120118
### [1.4.5](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.4...v1.4.5) (2025-03-10)
121119

122-
123120
### Bug Fixes
124121

125122
* fix workflow ([38969a5](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/38969a598b35ca4408e79ce98d53ae5780efe32b))
126123

127124
### [1.4.4](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.3...v1.4.4) (2025-03-10)
128125

129-
130126
### Bug Fixes
131127

132128
* fix workflow ([2013490](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/201349079931e3c4fd4d102c189e3d63d41ebf66))
133129

134130
### [1.4.3](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.2...v1.4.3) (2025-03-10)
135131

136-
137132
### Bug Fixes
138133

139134
* fix workflow ([7697bc4](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/7697bc40b4f00c825bdae0f421381fcfd49923c3))
@@ -142,19 +137,16 @@ All notable changes to this project will be documented in this file. See [standa
142137

143138
### [1.4.1](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.4.0...v1.4.1) (2025-03-10)
144139

145-
146140
### Bug Fixes
147141

148142
* fix scripts ([271354d](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/271354d5ffafbfd8451ed763a4a64d851a0d9f7d))
149143

150144
## 1.4.0 (2025-03-10)
151145

152-
153146
### ✨ Features | 新功能
154147

155148
* 优化工作流 ([ee33c15](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/ee33c155fe013b7e8342fd42785aa1920da58dd5))
156149

157-
158150
### 📦 Chores | 其他更新
159151

160152
* **release:** 1.0.1 ([5216dc2](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/5216dc2997e7d7edfbe18b6b51df8fdd68c71637))
@@ -169,7 +161,6 @@ All notable changes to this project will be documented in this file. See [standa
169161
* sync agent-ui component before release ([0d24ce6](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/0d24ce6ec687f5dc5941ec18de6109c2abda9273))
170162
* sync agent-ui component before release ([43b22b6](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/43b22b677860115841400cba0c9fd0e4db2afdb0))
171163

172-
173164
### 🐛 Bug Fixes | Bug 修复
174165

175166
* 优化发布流程 ([e57ba51](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/e57ba51c751959976ea88a185bec8ac1ce2ae12b))

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ Page({
103103
allowUploadFile: true, // 允许上传文件
104104
allowPullRefresh: true, // 允许下拉刷新
105105
allowUploadImage: true, // 允许上传图片
106+
allowMultiConversation: true, // 允许客户端界面展示会话列表及新建会话按钮
107+
showToolCallDetail: true, // 允许展示 mcp server toolcall 细节
106108
},
107109
modelConfig: {
108110
modelProvider: "hunyuan-open", // 大模型服务厂商
@@ -147,13 +149,15 @@ Page({
147149

148150
#### AgentConfig
149151

150-
| 参数 | 类型 | 必填 | 说明 |
151-
| -------------------- | ----------- | ---- | --------------------------------------------- |
152-
| `botId` | `String` || Agent的唯一标识ID,当 chatMode = 'bot' 时必填 |
153-
| `allowWebSearch` | `Boolean` || 是否允许客户端界面展示联网搜索 |
154-
| `allowUploadFile` | `Boolean` || 是否允许客户端界面展示文件上传 |
155-
| `allowPullRefresh` | `Boolean` || 是否允许客户端界面展示下拉获取历史记录 |
156-
| `allowUploadImage` | `Boolean` || 是否允许客户端界面展示图片上传及拍照上传 |
152+
| 参数 | 类型 | 必填 | 说明 |
153+
| -------------------------- | ----------- | ---- | --------------------------------------------- |
154+
| `botId` | `String` || Agent的唯一标识ID,当 chatMode = 'bot' 时必填 |
155+
| `allowWebSearch` | `Boolean` || 是否允许客户端界面展示联网搜索 |
156+
| `allowUploadFile` | `Boolean` || 是否允许客户端界面展示文件上传 |
157+
| `allowPullRefresh` | `Boolean` || 是否允许客户端界面展示下拉获取历史记录 |
158+
| `allowUploadImage` | `Boolean` || 是否允许客户端界面展示图片上传及拍照上传 |
159+
| `allowMultiConversation` | `Boolean` || 是否允许客户端界面展示会话列表及新建会话按钮 |
160+
| `showToolCallDetail` | `Boolean` || 是否允许展示 mcp server toolcall 细节 |
157161

158162
#### ModelConfig
159163

@@ -164,11 +168,16 @@ Page({
164168
| `logo` | `String` || 页面 logo,当 chatMode = 'model' 时生效,选填 |
165169
| `welcomeMsg` | `String` || 欢迎语,当 chatMode = 'model' 时生效,选填 |
166170

167-
> [!IMPORTANT]
171+
> **上传文件限制**
168172
> 大小限制:单文件不超过10M
169173
> 数量限制:单次最多支持 5 个文件
170174
> 文件类型:pdf、txt、doc、docx、ppt、pptx、xls、xlsx、csv
171-
> **request合法域名配置**:微信小程序上传文件需要添加“文件上传接口”到request合法域名列表,文件上传域名为:https://{your-envid}.api.tcloudbasegateway.com, 可前往[微信公众平台](https://mp.weixin.qq.com)配置request合法域名
175+
176+
> **上传图片限制**
177+
> 大小限制:单文件不超过30M
178+
> 数量限制:单次最多支持 1 个文件
179+
180+
> **request合法域名配置**:微信小程序 Agent-UI 组件支持 上传文件&多会话 需要添加云开发域名到request合法域名列表,云开发域名为:https://{your-envid}.api.tcloudbasegateway.com, 可前往[微信公众平台](https://mp.weixin.qq.com)配置request合法域名
172181
173182
配置示例
174183

@@ -255,6 +264,8 @@ Page({
255264
allowUploadFile: true, // 允许上传文件
256265
allowPullRefresh: true, // 允许下拉刷新
257266
allowUploadImage: true, // 允许上传图片及拍照上传
267+
allowMultiConversation: true, // 允许客户端界面展示会话列表及新建会话按钮
268+
showToolCallDetail: true, // 允许展示 mcp server toolcall 细节
258269
}
259270
}
260271
//...
@@ -270,16 +281,17 @@ Page({
270281
- ✅ 流式输出
271282
- ✅ 联网搜索 (Agent模式)
272283
- ✅ 文档解析 (Agent模式)
273-
- ✅ 图片上传解析(拍照/图片)
284+
- ✅ 图片上传解析(拍照/图片)(Agent模式)
285+
- ✅ 支持环境共享下使用
286+
- ✅ 历史会话管理,多轮对话上下文记忆(Agent模式)
287+
- ✅ 支持 MCP 调用(Agent模式)
274288

275289
### 🚧 进行中开发
276290

277291
- 多模型(快速响应/深度推理)切换调用配置化
278-
- 历史会话管理,多轮对话上下文记忆
279292
- 支持文字转语音播放
280293
- 支持用户语音输入转文字
281294
- 支持语音音色配置
282-
- agent支持环境共享下使用
283295

284296
### 📅 未来计划
285297

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

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,64 +35,31 @@ Component({
3535
const appBaseInfo = wx.getAppBaseInfo();
3636
const fileId = res.fileID;
3737
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, status: "parsing" });
38-
3938
console.log("当前版本", appBaseInfo.SDKVersion);
40-
// 3.8.1 及以上版本走sdk 内置方法
41-
if (compareVersions(appBaseInfo.SDKVersion, "3.8.1") < 0) {
42-
const { token } = await cloudInstance.extend.AI.bot.tokenManager.getToken();
43-
commonRequest({
44-
url: `https://${
45-
cloudInstance.env || cloudInstance.extend.AI.bot.context.env
46-
}.api.tcloudbasegateway.com/v1/aibot/bots/${botId}/files`,
47-
data: {
48-
fileList: [
49-
{
50-
fileName: rawFileName || tempFileName,
51-
fileId,
52-
type: rawType,
53-
},
54-
],
55-
},
56-
header: {
57-
Authorization: `Bearer ${token}`,
58-
},
59-
method: "POST",
60-
success: (res) => {
61-
console.log("old resolve agent file res", res);
62-
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parsed" });
63-
},
64-
fail: (e) => {
65-
console.log("resolve agent file e", e);
66-
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parseFailed" });
67-
},
68-
});
69-
} else {
70-
const ai = cloudInstance.extend.AI;
71-
ai.request({
72-
path: `bots/${botId}/files`, // 填写 "v1/aibot/" 后面的内容
73-
data: {
74-
fileList: [
75-
{
76-
fileName: rawFileName || tempFileName,
77-
fileId,
78-
type: rawType,
79-
},
80-
],
81-
}, // any
82-
method: "POST",
83-
timeout: 30000,
84-
success: (res) => {
85-
console.log("resolve agent file res", res);
86-
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parsed" });
87-
},
88-
fail: (e) => {
89-
console.log("e", e);
90-
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parseFailed" });
91-
},
92-
complete: () => {},
93-
header: {},
94-
});
95-
}
39+
commonRequest({
40+
path: `bots/${botId}/files`,
41+
data: {
42+
fileList: [
43+
{
44+
fileName: rawFileName || tempFileName,
45+
fileId,
46+
type: rawType,
47+
},
48+
],
49+
}, // any
50+
method: "POST",
51+
timeout: 60000,
52+
success: (res) => {
53+
console.log("resolve agent file res", res);
54+
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parsed" });
55+
},
56+
fail: (e) => {
57+
console.log("e", e);
58+
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parseFailed" });
59+
},
60+
complete: () => {},
61+
header: {},
62+
})
9663
},
9764
fail: (err) => {
9865
console.error("上传失败:", err);
Lines changed: 1 addition & 1 deletion
Loading

0 commit comments

Comments
 (0)