Skip to content

Commit

Permalink
fix: fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrjing committed Feb 28, 2025
1 parent 802bbf1 commit 2b95416
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Component({
model: "", // 具体的模型版本
logo: "", // 图标(只在model模式下生效)
welcomeMessage: "", // 欢迎语(只在model模式下生效)
allowWebSearch: true,
allowWebSearch: Boolean,
},
},
},
Expand Down Expand Up @@ -139,12 +139,15 @@ Component({
const { chatRecords } = this.data;
// 随机选取三个初始化问题
const questions = randomSelectInitquestion(bot.initQuestions, 3);
let allowWebSearch = this.data.agentConfig.allowWebSearch
console.log('allowWebSearch', allowWebSearch)
allowWebSearch = allowWebSearch === undefined ? true : allowWebSearch
this.setData({
bot,
questions,
chatRecords: [...chatRecords, record],
showWebSearchSwitch:
!!(bot.searchEnable && this.data.agentConfig.allowWebSearch),
!!(bot.searchEnable && allowWebSearch),
});
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Page({
model: "deepseek-r1", // 具体的模型版本 //
logo: "https://docs.cloudbase.net/img/logo.svg", // 图标(只在model模式下生效)
welcomeMessage: "欢迎语!", // 欢迎语(只在model模式下生效)
allowWebSearch: true, // 允许界面呈现联网配置开关
// allowWebSearch: true, // 允许界面呈现联网配置开关
},
},

Expand Down
4 changes: 3 additions & 1 deletion miniprogram/tcb-agent-ui/miniprogram/pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Page({
{ name: 'model', type: 'string', desc: "具体使用的模型,当 type = 'model' 时,必填。与 modelName 组合使用,可选的组合 [{modelName:'hunyuan-open',model:'hunyuan-lite'},{modelName:'hunyuan-exp',model:'hunyuan-lite'},{modelName:'deepseek',model:'deepseek-r1'},{modelName:'deepseek',model:'deepseek-v3'},{modelName:'hunyuan-open',model:'hunyuan-vision'}]" },
{ name: 'logo', type: 'string', desc: "页面 logo,当 type = 'model' 时,选填" },
{ name: 'welcomeMessage', type: 'string', desc: "欢迎语,当 type = 'model' 时,选填" },
{name: 'allowWebSearch', type: 'boolean', desc: "界面是否展示联网搜索开关 选填"}
],
guide: [`{
"usingComponents": {
Expand All @@ -71,7 +72,8 @@ Page({
modelName: "deepseek", // 大模型服务商
model: "deepseek-r1", // 具体的模型版本
logo: "123",// 图标(只在model模式下生效)
welcomeMessage: "123"// 欢迎语(只在model模式下生效)
welcomeMessage: "123",// 欢迎语(只在model模式下生效)
allowWebSearch: true // 界面展示联网搜索开关
}
}`]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<view style="margin-bottom:16px;font-size: 14px;line-height: 24px;text-align: justify;">
<view> <text style="font-weight: 500;">字段:</text>{{item.name}}</view>
<view><text style="font-weight: 500;">类型:</text>{{item.type}}</view>
<view><text style="font-weight: 500;">说明:</text>说明:{{item.desc}}</view>
<view><text style="font-weight: 500;">说明:</text>{{item.desc}}</view>
</view>
</block>
</view>
Expand Down

0 comments on commit 2b95416

Please sign in to comment.