({ metadata, showDetails, compact })
| 63 | showDetails?: boolean; |
| 64 | compact?: boolean; |
| 65 | }> = ({ metadata, showDetails, compact }) => { |
| 66 | const { tool, tool_id, arguments: args } = metadata; |
| 67 | |
| 68 | return ( |
| 69 | <div className={`${styles.toolCallMessage} ${compact ? styles.compact : ''}`}> |
| 70 | <Space direction="vertical" style={{ width: '100%' }}> |
| 71 | <Space> |
| 72 | <ToolOutlined className={styles.toolIcon} /> |
| 73 | <Text strong className={styles.toolName}> |
| 74 | 🔧 调用工具: {tool} |
| 75 | </Text> |
| 76 | <Tag color="blue" style={{ fontSize: '10px' }}> |
| 77 | {tool_id} |
| 78 | </Tag> |
| 79 | </Space> |
| 80 | |
| 81 | {showDetails && args && Object.keys(args).length > 0 && ( |
| 82 | <Collapse ghost size="small"> |
| 83 | <Panel |
| 84 | header={<Text type="secondary" style={{ fontSize: '12px' }}>参数详情</Text>} |
| 85 | key="args" |
| 86 | > |
| 87 | <pre className={styles.argsPanel}> |
| 88 | {JSON.stringify(args, null, 2)} |
| 89 | </pre> |
| 90 | </Panel> |
| 91 | </Collapse> |
| 92 | )} |
| 93 | </Space> |
| 94 | </div> |
| 95 | ); |
| 96 | }; |
| 97 | |
| 98 | /** |
| 99 | * 工具结果消息组件 |
nothing calls this directly
no outgoing calls
no test coverage detected