Handler with no parameters: def handler() -> str
(self)
| 105 | assert received_inv.tool_call_id == "call-456" |
| 106 | |
| 107 | async def test_zero_param_handler(self): |
| 108 | """Handler with no parameters: def handler() -> str""" |
| 109 | called = False |
| 110 | |
| 111 | @define_tool("test", description="Test tool") |
| 112 | def test_tool() -> str: |
| 113 | nonlocal called |
| 114 | called = True |
| 115 | return "ok" |
| 116 | |
| 117 | invocation = ToolInvocation( |
| 118 | session_id="s1", |
| 119 | tool_call_id="c1", |
| 120 | tool_name="test", |
| 121 | arguments={}, |
| 122 | ) |
| 123 | |
| 124 | result = await test_tool.handler(invocation) |
| 125 | |
| 126 | assert called |
| 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""" |
nothing calls this directly
no test coverage detected