(self)
| 261 | """ |
| 262 | |
| 263 | def __init__(self): |
| 264 | # _handlers 是一个字典:工具名 → 执行函数 |
| 265 | # 就像一本电话簿:名字 → 电话号码 |
| 266 | self._handlers: dict[str, Callable[[dict], str]] = {} |
| 267 | # _specs 保存工具的说明书 |
| 268 | self._specs: dict[str, ToolSpec] = {} |
| 269 | |
| 270 | def register(self, spec: ToolSpec, handler: Callable[[dict], str]) -> "ToolExecutor": |
| 271 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected