(invocation: ToolInvocation)
| 46 | |
| 47 | def _make_tool(name: str, handler) -> Tool: |
| 48 | async def wrapped(invocation: ToolInvocation) -> ToolResult: |
| 49 | args = invocation.arguments or {} |
| 50 | result = handler(args) |
| 51 | if inspect.isawaitable(result): |
| 52 | result = await result |
| 53 | return ToolResult(text_result_for_llm=str(result)) |
| 54 | |
| 55 | return Tool( |
| 56 | name=name, |
nothing calls this directly
no test coverage detected
searching dependent graphs…