(**kwargs)
| 382 | call_count = [0] |
| 383 | |
| 384 | async def mock_completion(**kwargs): |
| 385 | call_count[0] += 1 |
| 386 | if call_count[0] == 1: |
| 387 | return { |
| 388 | "response": "", |
| 389 | "tool_calls": [ |
| 390 | { |
| 391 | "id": "call_1", |
| 392 | "type": "function", |
| 393 | "function": {"name": "sqrt", "arguments": '{"x": 16}'}, |
| 394 | } |
| 395 | ], |
| 396 | } |
| 397 | else: |
| 398 | return {"response": "The result is 4", "tool_calls": []} |
| 399 | |
| 400 | context.client.create_completion = mock_completion |
| 401 |
nothing calls this directly
no outgoing calls
no test coverage detected