Skip to content
Merged

Dev #50

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

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.10.1](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.10.0...v1.10.1) (2025-04-23)


### Bug Fixes

* add compatible logic ([af3c6fb](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/af3c6fb19eea1eebeef9b4533e42436bb9f7289b))
* remove comment ([6f76b6c](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/6f76b6c090bbcb661641113ef8ed06831c7f5780))

## [1.10.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.9.1...v1.10.0) (2025-04-23)


Expand Down
32 changes: 21 additions & 11 deletions apps/miniprogram-agent-ui/miniprogram/components/agent-ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,28 @@ Component({
const res = await this.fetchConversationList(true, this.data.bot.botId);
if (res) {
const { data } = res;
console.log("data default", data.code);
console.log("default conversation", data);
if (data && !data.code) {
console.log("data", data);
this.setData({
defaultConversation: data,
conversations: [data],
transformConversations: this.transformConversationList([data]),
// conversationPageOptions: {
// ...this.data.conversationPageOptions,
// total: data.total,
// },
});
// 区分旧的默认会话结构与新的默认会话结构
if (data.data) {
if (data.data.length) {
this.setData({
defaultConversation: data.data[0],
conversations: data.data,
transformConversations: this.transformConversationList(data.data),
});
}
} else {
this.setData({
defaultConversation: data,
conversations: [data],
transformConversations: this.transformConversationList([data]),
// conversationPageOptions: {
// ...this.data.conversationPageOptions,
// total: data.total,
// },
});
}
}
}
}
Expand Down
38 changes: 24 additions & 14 deletions components/agent-ui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,28 @@ Component({
const res = await this.fetchConversationList(true, this.data.bot.botId);
if (res) {
const { data } = res;
console.log("data default", data.code);
console.log("default conversation", data);
if (data && !data.code) {
console.log("data", data);
this.setData({
defaultConversation: data,
conversations: [data],
transformConversations: this.transformConversationList([data]),
// conversationPageOptions: {
// ...this.data.conversationPageOptions,
// total: data.total,
// },
});
// 区分旧的默认会话结构与新的默认会话结构
if (data.data) {
if (data.data.length) {
this.setData({
defaultConversation: data.data[0],
conversations: data.data,
transformConversations: this.transformConversationList(data.data),
});
}
} else {
this.setData({
defaultConversation: data,
conversations: [data],
transformConversations: this.transformConversationList([data]),
// conversationPageOptions: {
// ...this.data.conversationPageOptions,
// total: data.total,
// },
});
}
}
}
}
Expand Down Expand Up @@ -1202,7 +1212,7 @@ Component({
let endTime = null; // 记录结束思考时间
let index = 0;
for await (let event of res.eventStream) {
console.log("event", event);
// console.log("event", event);
const { chatStatus } = this.data;
if (chatStatus === 0) {
isManuallyPaused = true;
Expand Down Expand Up @@ -1378,7 +1388,7 @@ Component({
// tool_call 场景,调用响应
if (type === "tool-result") {
const { toolCallId, result } = dataJson;
console.log("tool-result", result);
// console.log("tool-result", result);
if (lastValue.toolCallList && lastValue.toolCallList.length) {
const lastToolCallObj = lastValue.toolCallList.find((item) => item.id === toolCallId);
if (lastToolCallObj && !lastToolCallObj.callResult) {
Expand Down Expand Up @@ -1409,7 +1419,7 @@ Component({
[`chatRecords[${lastValueIndex}].content`]: lastValue.content,
});
}
console.log("this.data.chatRecords", this.data.chatRecords);
// console.log("this.data.chatRecords", this.data.chatRecords);
this.setData({
chatStatus: 0,
[`chatRecords[${lastValueIndex}].hiddenBtnGround`]: isManuallyPaused,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cloudbase-agent-ui",
"version": "1.10.0",
"version": "1.10.1",
"description": "微信小程序 Agent UI组件",
"main": "index.js",
"directories": {
Expand Down
Loading