File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
apps/miniprogram-agent-ui/miniprogram/components/agent-ui Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,9 @@ Page({
147147
148148![ ] ( https://qcloudimg.tencent-cloud.cn/raw/b45a95e06ec0df8dab5c9d9ec7707faa.png )
149149
150- #### 4. agent-ui 组件工具卡片组件中配置自定义组件映射
150+ #### 4. 实现 Agent UI customCard 组件
151+
152+ - 在agent-ui customCard 组件(agent-ui/customCard/index.wxml) 中添加自定义逻辑,可根据不同 tool 类型渲染不同自定义组件
151153
152154![ ] ( https://qcloudimg.tencent-cloud.cn/raw/b4cd35ccaa3e72189934ed59d35f7ae5.png )
153155
Original file line number Diff line number Diff line change @@ -398,12 +398,8 @@ Component({
398398 } ,
399399 transformToolName : function ( str ) {
400400 if ( str ) {
401- const strArr = str . split ( "/" ) ;
402- if ( strArr [ 1 ] ) {
403- return strArr [ 1 ] ;
404- } else if ( strArr [ 0 ] ) {
405- return strArr [ 0 ] ;
406- }
401+ const strArr = str . split ( / \/ + / ) ;
402+ return strArr [ strArr . length - 1 ] ;
407403 }
408404 return "" ;
409405 } ,
You can’t perform that action at this time.
0 commit comments