工具结果块 —— 工具执行后的返回结果。 例子:ToolResultBlock(tool_use_id="tool-1", tool_name="bash", output="file1.py\nfile2.py", is_error=False) 参数: tool_use_id: 对应哪次工具调用(和 ToolUseBlock 的 id 对应) tool_name: 工具名称 output: 工具的输出结果 is_error: 执行是否出错了
| 89 | |
| 90 | @dataclass(frozen=True) |
| 91 | class ToolResultBlock: |
| 92 | """ |
| 93 | 工具结果块 —— 工具执行后的返回结果。 |
| 94 | |
| 95 | 例子:ToolResultBlock(tool_use_id="tool-1", tool_name="bash", output="file1.py\nfile2.py", is_error=False) |
| 96 | |
| 97 | 参数: |
| 98 | tool_use_id: 对应哪次工具调用(和 ToolUseBlock 的 id 对应) |
| 99 | tool_name: 工具名称 |
| 100 | output: 工具的输出结果 |
| 101 | is_error: 执行是否出错了 |
| 102 | """ |
| 103 | tool_use_id: str |
| 104 | tool_name: str |
| 105 | output: str |
| 106 | is_error: bool = False |
| 107 | type: str = "tool_result" |
| 108 | |
| 109 | |
| 110 | # ContentBlock 可以是以上三种之一 |
no outgoing calls
no test coverage detected