一个简单的加法工具。 输入: "2,2" 这样的字符串 输出: "4" 计算结果的字符串
(input_str: str)
| 130 | # 对应源码: rust/crates/tools/src/lib.rs |
| 131 | |
| 132 | def tool_add(input_str: str) -> str: |
| 133 | """ |
| 134 | 一个简单的加法工具。 |
| 135 | 输入: "2,2" 这样的字符串 |
| 136 | 输出: "4" 计算结果的字符串 |
| 137 | """ |
| 138 | numbers = [int(x.strip()) for x in input_str.split(",")] |
| 139 | result = sum(numbers) |
| 140 | return str(result) |
| 141 | |
| 142 | |
| 143 | # 工具注册表:名称 → 函数 |
nothing calls this directly
no outgoing calls
no test coverage detected