MCPcopy Create free account
hub / github.com/IBM/mcp-cli / mock_completion

Method mock_completion

tests/chat/test_conversation.py:384–398  ·  view source on GitHub ↗
(**kwargs)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected