(self, ctx: ToolContext, tool_use: _ToolUse, can_use_tool=None)
| 68 | return ctx |
| 69 | |
| 70 | def _execute(self, ctx: ToolContext, tool_use: _ToolUse, can_use_tool=None) -> list: |
| 71 | # The services lane fails CLOSED without a permission handler, so |
| 72 | # tests that want execution must say so explicitly. |
| 73 | if can_use_tool is None: |
| 74 | def can_use_tool(*_a, **_k): |
| 75 | return {"behavior": "allow"} |
| 76 | |
| 77 | async def drive(): |
| 78 | updates = [] |
| 79 | async for update in run_tool_use( |
| 80 | tool_use, |
| 81 | AssistantMessage(content="using a tool"), |
| 82 | can_use_tool, |
| 83 | ctx, |
| 84 | ): |
| 85 | updates.append(update) |
| 86 | return updates |
| 87 | |
| 88 | return _run(drive()) |
| 89 | |
| 90 | @staticmethod |
| 91 | def _result_blocks(updates: list) -> list[dict]: |
no test coverage detected