MCPcopy
hub / github.com/openai/swarm / set_response

Method set_response

tests/mock_client.py:49–54  ·  view source on GitHub ↗

Set the mock to return a specific response. :param response: A ChatCompletion response to return.

(self, response: ChatCompletion)

Source from the content-addressed store, hash-verified

47 self.chat.completions = MagicMock()
48
49 def set_response(self, response: ChatCompletion):
50 """
51 Set the mock to return a specific response.
52 :param response: A ChatCompletion response to return.
53 """
54 self.chat.completions.create.return_value = response
55
56 def set_sequential_responses(self, responses: list[ChatCompletion]):
57 """

Callers 1

mock_openai_clientFunction · 0.95

Calls

no outgoing calls

Tested by 1

mock_openai_clientFunction · 0.76