Skip to content
Merged

Dev #43

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
31 changes: 11 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

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.

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

### Features

* 支持多会话

### Bug Fixes

* 修复系统提示语在切会话时插入位置bug ([7c3e77a](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/7c3e77a2b13b5a33c18e0821fc4eb23937ebdfd5))
* 支持request 域名校验 ([5c21561](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/5c21561ffc06523bbcb7fcb3b91b17f492ab4b8f))

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

### Bug Fixes

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

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


### Bug Fixes

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

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


### Features

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


### Bug Fixes

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

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


### Features

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


### Bug Fixes

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

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


### Features

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


### Bug Fixes

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

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


### Features

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


### Bug Fixes

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

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


### Bug Fixes

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

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


### Bug Fixes

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

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


### Bug Fixes

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

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


### Bug Fixes

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

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


### Bug Fixes

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

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


### Bug Fixes

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

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


### Bug Fixes

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

## 1.4.0 (2025-03-10)


### ✨ Features | 新功能

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


### 📦 Chores | 其他更新

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


### 🐛 Bug Fixes | Bug 修复

* 优化发布流程 ([e57ba51](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/e57ba51c751959976ea88a185bec8ac1ce2ae12b))
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Page({
allowUploadFile: true, // 允许上传文件
allowPullRefresh: true, // 允许下拉刷新
allowUploadImage: true, // 允许上传图片
allowMultiConversation: true, // 允许客户端界面展示会话列表及新建会话按钮
showToolCallDetail: true, // 允许展示 mcp server toolcall 细节
},
modelConfig: {
modelProvider: "hunyuan-open", // 大模型服务厂商
Expand Down Expand Up @@ -147,13 +149,15 @@ Page({

#### AgentConfig

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

#### ModelConfig

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

> [!IMPORTANT]
> **上传文件限制**
> 大小限制:单文件不超过10M
> 数量限制:单次最多支持 5 个文件
> 文件类型:pdf、txt、doc、docx、ppt、pptx、xls、xlsx、csv
> **request合法域名配置**:微信小程序上传文件需要添加“文件上传接口”到request合法域名列表,文件上传域名为:https://{your-envid}.api.tcloudbasegateway.com, 可前往[微信公众平台](https://mp.weixin.qq.com)配置request合法域名

> **上传图片限制**
> 大小限制:单文件不超过30M
> 数量限制:单次最多支持 1 个文件

> **request合法域名配置**:微信小程序 Agent-UI 组件支持 上传文件&多会话 需要添加云开发域名到request合法域名列表,云开发域名为:https://{your-envid}.api.tcloudbasegateway.com, 可前往[微信公众平台](https://mp.weixin.qq.com)配置request合法域名

配置示例

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

### 🚧 进行中开发

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

### 📅 未来计划

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,64 +35,31 @@ Component({
const appBaseInfo = wx.getAppBaseInfo();
const fileId = res.fileID;
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, status: "parsing" });

console.log("当前版本", appBaseInfo.SDKVersion);
// 3.8.1 及以上版本走sdk 内置方法
if (compareVersions(appBaseInfo.SDKVersion, "3.8.1") < 0) {
const { token } = await cloudInstance.extend.AI.bot.tokenManager.getToken();
commonRequest({
url: `https://${
cloudInstance.env || cloudInstance.extend.AI.bot.context.env
}.api.tcloudbasegateway.com/v1/aibot/bots/${botId}/files`,
data: {
fileList: [
{
fileName: rawFileName || tempFileName,
fileId,
type: rawType,
},
],
},
header: {
Authorization: `Bearer ${token}`,
},
method: "POST",
success: (res) => {
console.log("old resolve agent file res", res);
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parsed" });
},
fail: (e) => {
console.log("resolve agent file e", e);
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parseFailed" });
},
});
} else {
const ai = cloudInstance.extend.AI;
ai.request({
path: `bots/${botId}/files`, // 填写 "v1/aibot/" 后面的内容
data: {
fileList: [
{
fileName: rawFileName || tempFileName,
fileId,
type: rawType,
},
],
}, // any
method: "POST",
timeout: 30000,
success: (res) => {
console.log("resolve agent file res", res);
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parsed" });
},
fail: (e) => {
console.log("e", e);
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parseFailed" });
},
complete: () => {},
header: {},
});
}
commonRequest({
path: `bots/${botId}/files`,
data: {
fileList: [
{
fileName: rawFileName || tempFileName,
fileId,
type: rawType,
},
],
}, // any
method: "POST",
timeout: 60000,
success: (res) => {
console.log("resolve agent file res", res);
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parsed" });
},
fail: (e) => {
console.log("e", e);
this.triggerEvent("changeChild", { tempId: this.data.fileData.tempId, fileId, status: "parseFailed" });
},
complete: () => {},
header: {},
})
},
fail: (err) => {
console.error("上传失败:", err);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading