Handler with only invocation: def handler(invocation) -> str
(self)
| 127 | assert result.text_result_for_llm == "ok" |
| 128 | |
| 129 | async def test_invocation_only_handler(self): |
| 130 | """Handler with only invocation: def handler(invocation) -> str""" |
| 131 | received_inv = None |
| 132 | |
| 133 | @define_tool("test", description="Test tool") |
| 134 | def test_tool(invocation: ToolInvocation) -> str: |
| 135 | nonlocal received_inv |
| 136 | received_inv = invocation |
| 137 | return "ok" |
| 138 | |
| 139 | invocation = ToolInvocation( |
| 140 | session_id="s1", |
| 141 | tool_call_id="c1", |
| 142 | tool_name="test", |
| 143 | arguments={}, |
| 144 | ) |
| 145 | |
| 146 | await test_tool.handler(invocation) |
| 147 | |
| 148 | assert received_inv is not None |
| 149 | assert received_inv.session_id == "s1" |
| 150 | |
| 151 | async def test_params_only_handler(self): |
| 152 | """Handler with only params: def handler(params) -> str""" |
nothing calls this directly
no test coverage detected