Handler with only params: def handler(params) -> str
(self)
| 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""" |
| 153 | |
| 154 | class Params(BaseModel): |
| 155 | value: str |
| 156 | |
| 157 | received_params = None |
| 158 | |
| 159 | @define_tool("test", description="Test tool") |
| 160 | def test_tool(params: Params) -> str: |
| 161 | nonlocal received_params |
| 162 | received_params = params |
| 163 | return "ok" |
| 164 | |
| 165 | invocation = ToolInvocation( |
| 166 | session_id="s1", |
| 167 | tool_call_id="c1", |
| 168 | tool_name="test", |
| 169 | arguments={"value": "hello"}, |
| 170 | ) |
| 171 | |
| 172 | await test_tool.handler(invocation) |
| 173 | |
| 174 | assert received_params is not None |
| 175 | assert received_params.value == "hello" |
| 176 | |
| 177 | async def test_handler_error_is_hidden_from_llm(self): |
| 178 | class Params(BaseModel): |
nothing calls this directly
no test coverage detected