Skip to content

Commit a951f14

Browse files
committed
fix: add toolCall detail config
1 parent 19be587 commit a951f14

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Component({
2323
allowWebSearch: Boolean,
2424
allowPullRefresh: Boolean,
2525
allowUploadImage: Boolean,
26+
showToolCallDetail: Boolean
2627
},
2728
},
2829
modelConfig: {
@@ -69,6 +70,7 @@ Component({
6970
showUploadImg: true,
7071
showWebSearchSwitch: false,
7172
showPullRefresh: true,
73+
showToolCallDetail: true,
7274
useWebSearch: false,
7375
showFeatureList: false,
7476
chatStatus: 0, // 页面状态: 0-正常状态,可输入,可发送, 1-发送中 2-思考中 3-输出content中
@@ -120,12 +122,13 @@ Component({
120122
const { chatRecords } = this.data;
121123
// 随机选取三个初始化问题
122124
const questions = randomSelectInitquestion(bot.initQuestions, 3);
123-
let { allowWebSearch, allowUploadFile, allowPullRefresh, allowUploadImage } = this.data.agentConfig;
125+
let { allowWebSearch, allowUploadFile, allowPullRefresh, allowUploadImage, showToolCallDetail } = this.data.agentConfig;
124126
console.log("allowWebSearch", allowWebSearch);
125127
allowWebSearch = allowWebSearch === undefined ? true : allowWebSearch;
126128
allowUploadFile = allowUploadFile === undefined ? true : allowUploadFile;
127129
allowPullRefresh = allowPullRefresh === undefined ? true : allowPullRefresh;
128130
allowUploadImage = allowUploadImage === undefined ? true : allowUploadImage;
131+
showToolCallDetail = showToolCallDetail === undefined ? true : showToolCallDetail
129132
console.log("allowUploadFile", allowUploadFile);
130133
this.setData({
131134
bot,
@@ -135,6 +138,7 @@ Component({
135138
showUploadFile: allowUploadFile,
136139
showUploadImg: allowUploadImage,
137140
showPullRefresh: allowPullRefresh,
141+
showToolCallDetail: showToolCallDetail
138142
});
139143
}
140144
const topHeight = await this.calculateContentInTop();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<text>{{item.reasoning_content&&!item.content?"思考中...":"已深度思考(用时"+item.thinkingTime+"秒)"}}</text>
8484
</block> -->
8585
</view>
86-
<view style="padding-left: 25rpx;margin-top: 28rpx; border-left: rgb(165, 164, 164) solid 2px; opacity: 0.7;" slot="content">
86+
<view wx:if="{{showToolCallDetail}}" style="padding-left: 25rpx;margin-top: 28rpx; border-left: rgb(165, 164, 164) solid 2px; opacity: 0.7;" slot="content">
8787
<view>参数:</view>
8888
<markdownPreview markdown="{{subItem.callParams||''}}" fontSize="{{28}}"></markdownPreview>
8989
<view>结果:</view>

apps/miniprogram-agent-ui/miniprogram/pages/chatBot/chatBot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Page({
1212
allowUploadFile: true, // 允许上传文件
1313
allowPullRefresh: true, // 允许下拉刷新
1414
allowUploadImage: true, // 允许上传图片
15+
showToolCallDetail: true, // 展示 toolCall 细节
1516
},
1617
modelConfig: {
1718
modelProvider: "deepseek", // 大模型服务厂商

apps/miniprogram-agent-ui/project.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@
6565
},
6666
"appid": "wx5ceb4e4809aa1d28",
6767
"libVersion": "3.7.8"
68-
}
68+
}

0 commit comments

Comments
 (0)