Arguments already parsed as dict (not JSON string).
(self)
| 1286 | assert _extract_tool_call({}) is None |
| 1287 | |
| 1288 | def test_dict_args_not_string(self): |
| 1289 | """Arguments already parsed as dict (not JSON string).""" |
| 1290 | response = { |
| 1291 | "tool_calls": [ |
| 1292 | { |
| 1293 | "id": "call_1", |
| 1294 | "type": "function", |
| 1295 | "function": { |
| 1296 | "name": "test_tool", |
| 1297 | "arguments": {"key": "value"}, |
| 1298 | }, |
| 1299 | } |
| 1300 | ], |
| 1301 | } |
| 1302 | result = _extract_tool_call(response) |
| 1303 | assert result is not None |
| 1304 | assert result["args"] == {"key": "value"} |
| 1305 | |
| 1306 | def test_invalid_json_arguments(self): |
| 1307 | """Malformed JSON in arguments defaults to empty dict.""" |
nothing calls this directly
no test coverage detected