Skip to content

Commit a28f8a6

Browse files
authored
Merge pull request #50 from TencentCloudBase/dev
Dev
2 parents d15972b + ba667ef commit a28f8a6

5 files changed

Lines changed: 56 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
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.10.1](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.10.0...v1.10.1) (2025-04-23)
6+
7+
8+
### Bug Fixes
9+
10+
* add compatible logic ([af3c6fb](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/af3c6fb19eea1eebeef9b4533e42436bb9f7289b))
11+
* remove comment ([6f76b6c](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/6f76b6c090bbcb661641113ef8ed06831c7f5780))
12+
513
## [1.10.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.9.1...v1.10.0) (2025-04-23)
614

715

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

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,28 @@ Component({
265265
const res = await this.fetchConversationList(true, this.data.bot.botId);
266266
if (res) {
267267
const { data } = res;
268-
console.log("data default", data.code);
268+
console.log("default conversation", data);
269269
if (data && !data.code) {
270-
console.log("data", data);
271-
this.setData({
272-
defaultConversation: data,
273-
conversations: [data],
274-
transformConversations: this.transformConversationList([data]),
275-
// conversationPageOptions: {
276-
// ...this.data.conversationPageOptions,
277-
// total: data.total,
278-
// },
279-
});
270+
// 区分旧的默认会话结构与新的默认会话结构
271+
if (data.data) {
272+
if (data.data.length) {
273+
this.setData({
274+
defaultConversation: data.data[0],
275+
conversations: data.data,
276+
transformConversations: this.transformConversationList(data.data),
277+
});
278+
}
279+
} else {
280+
this.setData({
281+
defaultConversation: data,
282+
conversations: [data],
283+
transformConversations: this.transformConversationList([data]),
284+
// conversationPageOptions: {
285+
// ...this.data.conversationPageOptions,
286+
// total: data.total,
287+
// },
288+
});
289+
}
280290
}
281291
}
282292
}

components/agent-ui/index.js

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,28 @@ Component({
265265
const res = await this.fetchConversationList(true, this.data.bot.botId);
266266
if (res) {
267267
const { data } = res;
268-
console.log("data default", data.code);
268+
console.log("default conversation", data);
269269
if (data && !data.code) {
270-
console.log("data", data);
271-
this.setData({
272-
defaultConversation: data,
273-
conversations: [data],
274-
transformConversations: this.transformConversationList([data]),
275-
// conversationPageOptions: {
276-
// ...this.data.conversationPageOptions,
277-
// total: data.total,
278-
// },
279-
});
270+
// 区分旧的默认会话结构与新的默认会话结构
271+
if (data.data) {
272+
if (data.data.length) {
273+
this.setData({
274+
defaultConversation: data.data[0],
275+
conversations: data.data,
276+
transformConversations: this.transformConversationList(data.data),
277+
});
278+
}
279+
} else {
280+
this.setData({
281+
defaultConversation: data,
282+
conversations: [data],
283+
transformConversations: this.transformConversationList([data]),
284+
// conversationPageOptions: {
285+
// ...this.data.conversationPageOptions,
286+
// total: data.total,
287+
// },
288+
});
289+
}
280290
}
281291
}
282292
}
@@ -1202,7 +1212,7 @@ Component({
12021212
let endTime = null; // 记录结束思考时间
12031213
let index = 0;
12041214
for await (let event of res.eventStream) {
1205-
console.log("event", event);
1215+
// console.log("event", event);
12061216
const { chatStatus } = this.data;
12071217
if (chatStatus === 0) {
12081218
isManuallyPaused = true;
@@ -1378,7 +1388,7 @@ Component({
13781388
// tool_call 场景,调用响应
13791389
if (type === "tool-result") {
13801390
const { toolCallId, result } = dataJson;
1381-
console.log("tool-result", result);
1391+
// console.log("tool-result", result);
13821392
if (lastValue.toolCallList && lastValue.toolCallList.length) {
13831393
const lastToolCallObj = lastValue.toolCallList.find((item) => item.id === toolCallId);
13841394
if (lastToolCallObj && !lastToolCallObj.callResult) {
@@ -1409,7 +1419,7 @@ Component({
14091419
[`chatRecords[${lastValueIndex}].content`]: lastValue.content,
14101420
});
14111421
}
1412-
console.log("this.data.chatRecords", this.data.chatRecords);
1422+
// console.log("this.data.chatRecords", this.data.chatRecords);
14131423
this.setData({
14141424
chatStatus: 0,
14151425
[`chatRecords[${lastValueIndex}].hiddenBtnGround`]: isManuallyPaused,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cloudbase-agent-ui",
3-
"version": "1.10.0",
3+
"version": "1.10.1",
44
"description": "微信小程序 Agent UI组件",
55
"main": "index.js",
66
"directories": {

0 commit comments

Comments
 (0)