Skip to content

Commit 467cc48

Browse files
authored
Merge pull request #71 from TencentCloudBase/dev
Dev
2 parents ca62a1b + aa7ae88 commit 467cc48

File tree

13 files changed

+1540
-50
lines changed

13 files changed

+1540
-50
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +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.14.0](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.13.2...v1.14.0) (2025-06-11)
6+
7+
8+
### Features
9+
10+
* 增加 react 组件 artifact 示例 ([a78c8d9](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/a78c8d93997a94371b837b4f5b5dd60de0ebf183))
11+
12+
13+
### Bug Fixes
14+
15+
* 修复图片上传配置问题&函数型agent 语音播放按钮状态问题 ([74a584f](https://github.com/TencentCloudBase/cloudbase-agent-ui/commit/74a584f53ececefbfb4aadd420a3d372d26e4332))
16+
517
### [1.13.2](https://github.com/TencentCloudBase/cloudbase-agent-ui/compare/v1.13.1...v1.13.2) (2025-05-29)
618

719

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ Component({
13351335
data: {
13361336
botId: bot.botId,
13371337
msg: inputValue,
1338-
files: this.data.showUploadFile ? userRecord.fileList.map((item) => item.fileId) : undefined,
1338+
files: userRecord.fileList.length ? userRecord.fileList.map((item) => item.fileId) : undefined,
13391339
searchEnable: this.data.useWebSearch,
13401340
},
13411341
});
@@ -1359,7 +1359,7 @@ Component({
13591359
const sendReq = {
13601360
botId: bot.botId,
13611361
msg: inputValue,
1362-
files: this.data.showUploadFile ? userRecord.fileList.map((item) => item.fileId) : undefined,
1362+
files: userRecord.fileList.length ? userRecord.fileList.map((item) => item.fileId) : undefined,
13631363
searchEnable: this.data.useWebSearch,
13641364
};
13651365

@@ -1415,7 +1415,9 @@ Component({
14151415
const lastValueIndex = newValue.length - 1;
14161416
const lastValue = newValue[lastValueIndex];
14171417
lastValue.role = role || "assistant";
1418-
lastValue.record_id = record_id;
1418+
if (record_id) {
1419+
lastValue.record_id = record_id;
1420+
}
14191421
// 优先处理错误,直接中断
14201422
if (finish_reason === "error" || finish_reason === "content_filter" || error) {
14211423
lastValue.search_info = null;
@@ -1907,6 +1909,15 @@ Component({
19071909
},
19081910
handlePlayAudio: async function (e) {
19091911
console.log("handlePlayAudio e", e);
1912+
// 判断是否打开语音能力
1913+
if (!this.data.bot.voiceSettings?.enable) {
1914+
wx.showModal({
1915+
title: "提示",
1916+
content: "请前往腾讯云开发平台启用语音输入输出能力",
1917+
});
1918+
return;
1919+
}
1920+
19101921
const { recordid: botRecordId, content } = e.target.dataset;
19111922
const audioContext = this.data.audioContext;
19121923
if (audioContext.context) {

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,26 @@
157157
<block wx:if="{{chatMode=== 'bot'}}">
158158
<image mode="widthFix" bind:tap="openFeedback" data-feedbackType="upvote" data-feedbackRecordId="{{item.record_id}}" src='./imgs/thumb-up.svg' class="tool_btn" />
159159
<image mode="widthFix" bind:tap="openFeedback" data-feedbackType="downvote" data-feedbackRecordId="{{item.record_id}}" src='./imgs/thumb-down.svg' class="tool_btn" />
160-
<image wx:if="{{audioContext.recordId !== item.record_id || audioContext.playStatus === 0}}" mode="widthFix" bind:tap="handlePlayAudio" data-content="{{item.content}}" data-recordId="{{item.record_id}}" src='./imgs/sound.svg' class="tool_btn" />
161-
<image wx:elif="{{audioContext.playStatus === 1}}" mode="widthFix" src='./imgs/loading.svg' class="tool_btn" />
162-
<view wx:else class="playing_btn">
163-
<image style="width: 36rpx;height: 36rpx;" mode="widthFix" bind:tap="handlePauseAudio" data-recordId="{{item.record_id}}" src='./imgs/pause.svg' />
164-
<image style="width: 30rpx;height: 30rpx" src="./imgs/playing.svg" mode="widthFix"/>
165-
<!-- 倍速切换按钮 -->
166-
<view class="speed-switch" bindtap="toggleSpeedList" data-recordId="{{item.record_id}}">
167-
168-
<text class="speed-label">{{audioContext.currentSpeed || '1'}}</text>X
169-
</view>
170-
<!-- 倍速弹窗 -->
171-
<view wx:if="{{audioContext.showSpeedList && audioContext.recordId === item.record_id}}" class="speed-popup">
172-
<view wx:for="{{speedList}}" wx:key="item" class="speed-option" bindtap="chooseSpeed" data-speed="{{item}}" data-recordId="{{item.record_id}}">
173-
<text>{{item}}X</text>
174-
<image wx:if="{{audioContext.currentSpeed === item}}" src="./imgs/check.svg" style="width: 24rpx;height: 24rpx;margin-left:8rpx;" />
160+
<block wx:if="{{item.record_id}}">
161+
<image wx:if="{{audioContext.recordId !== item.record_id || audioContext.playStatus === 0}}" mode="widthFix" bind:tap="handlePlayAudio" data-content="{{item.content}}" data-recordId="{{item.record_id}}" src='./imgs/sound.svg' class="tool_btn" />
162+
<image wx:elif="{{audioContext.playStatus === 1}}" mode="widthFix" src='./imgs/loading.svg' class="tool_btn" />
163+
<view wx:else class="playing_btn">
164+
<image style="width: 36rpx;height: 36rpx;" mode="widthFix" bind:tap="handlePauseAudio" data-recordId="{{item.record_id}}" src='./imgs/pause.svg' />
165+
<image style="width: 30rpx;height: 30rpx" src="./imgs/playing.svg" mode="widthFix"/>
166+
<!-- 倍速切换按钮 -->
167+
<view class="speed-switch" bindtap="toggleSpeedList" data-recordId="{{item.record_id}}">
168+
169+
<text class="speed-label">{{audioContext.currentSpeed || '1'}}</text>X
175170
</view>
176-
</view>
177-
</view>
171+
<!-- 倍速弹窗 -->
172+
<view wx:if="{{audioContext.showSpeedList && audioContext.recordId === item.record_id}}" class="speed-popup">
173+
<view wx:for="{{speedList}}" wx:key="item" class="speed-option" bindtap="chooseSpeed" data-speed="{{item}}" data-recordId="{{item.record_id}}">
174+
<text>{{item}}X</text>
175+
<image wx:if="{{audioContext.currentSpeed === item}}" src="./imgs/check.svg" style="width: 24rpx;height: 24rpx;margin-left:8rpx;" />
176+
</view>
177+
</view>
178+
</view>
179+
</block>
178180
</block>
179181
</block>
180182
</view>

apps/react-agent-ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@cloudbase/agent-ui-react": "1.0.0-beta.4",
13+
"@cloudbase/agent-ui-react": "1.0.0-beta.5",
1414
"@cloudbase/js-sdk": "^2.13.0",
1515
"@react-three/drei": "^9.88.6",
1616
"@react-three/fiber": "^8.13.7",
1717
"jszip": "^3.10.1",
18+
"mermaid": "^11.6.0",
1819
"react": "^18.3.1",
1920
"react-dom": "^18.3.1",
2021
"three": "^0.152.2",

0 commit comments

Comments
 (0)