Invoke on_tool_call callback then run the tool, returning its string result.
(
tool_name: str,
tool_input: dict[str, Any],
on_tool_call: Any,
)
| 404 | |
| 405 | |
| 406 | async def _execute_tool( |
| 407 | tool_name: str, |
| 408 | tool_input: dict[str, Any], |
| 409 | on_tool_call: Any, |
| 410 | ) -> str: |
| 411 | """Invoke on_tool_call callback then run the tool, returning its string result.""" |
| 412 | if on_tool_call is not None: |
| 413 | await on_tool_call(tool_name, tool_input) |
| 414 | if tool_name in _TOOL_MAP: |
| 415 | return await _TOOL_MAP[tool_name](tool_input) |
| 416 | return f"Error: unknown tool '{tool_name}'." |
| 417 | |
| 418 | |
| 419 | async def _process_tool_turn( |
no outgoing calls
no test coverage detected