(self)
| 324 | |
| 325 | class TestGenericJSONCompiler: |
| 326 | def test_basic(self): |
| 327 | tool = { |
| 328 | "name": "search", |
| 329 | "description": "Search things", |
| 330 | "parameters": { |
| 331 | "properties": {"q": {"type": "string", "description": "Query"}}, |
| 332 | "required": ["q"], |
| 333 | }, |
| 334 | "returns": {"result": {"type": "string", "description": "The answer"}}, |
| 335 | } |
| 336 | spec = compile_generic_json(tool) |
| 337 | assert spec.name == "search" |
| 338 | assert len(spec.inputs) == 1 |
| 339 | assert spec.inputs[0].name == "q" |
| 340 | assert len(spec.outputs) == 1 |
| 341 | assert spec.outputs[0].name == "result" |
| 342 | |
| 343 | def test_list_params(self): |
| 344 | tool = { |
nothing calls this directly
no test coverage detected