File tree Expand file tree Collapse file tree
packages/plugins/robot/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -408,7 +408,7 @@ export default {
408408 },
409409 {
410410 label: ' 页面搭建场景' ,
411- description: ' 如何生成表单嵌进我的网站? ' ,
411+ description: ' 给当前页面中添加一个问卷调查表单 ' ,
412412 icon: h (' span' , { style: { fontSize: ' 18px' } as CSSProperties }, ' ✨' )
413413 },
414414 {
Original file line number Diff line number Diff line change @@ -75,18 +75,26 @@ const handleToolCall = async (
7575 formatPretty : true
7676 }
7777 currentMessage . renderContent . push ( currentToolMessage )
78- const toolCallResult = await useMcpServer ( ) . callTool ( name , parsedArgs )
78+ let toolCallResult
79+ let toolCallStatus
80+ try {
81+ toolCallStatus = 'success'
82+ toolCallResult = ( await useMcpServer ( ) . callTool ( name , parsedArgs ) ) . content
83+ } catch ( error ) {
84+ toolCallStatus = 'failed'
85+ toolCallResult = JSON . stringify ( error )
86+ }
7987 toolMessages . push ( {
8088 type : 'text' ,
81- content : toolCallResult . content ,
89+ content : toolCallResult ,
8290 role : 'tool' ,
8391 tool_call_id : tool . id
8492 } )
8593
86- currentMessage . renderContent . at ( - 1 ) ! . status = 'success'
94+ currentMessage . renderContent . at ( - 1 ) ! . status = toolCallStatus
8795 currentMessage . renderContent . at ( - 1 ) ! . content = {
8896 params : parsedArgs ,
89- result : toolCallResult . content
97+ result : toolCallResult
9098 }
9199 }
92100 currentMessage . renderContent . push ( { type : 'loading' , content : '' } )
You can’t perform that action at this time.
0 commit comments