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

Method set_sequential_responses

tests/mock_client.py:56–61  ·  view source on GitHub ↗

Set the mock to return different responses sequentially. :param responses: A list of ChatCompletion responses to return in order.

(self, responses: list[ChatCompletion])

Source from the content-addressed store, hash-verified

54 self.chat.completions.create.return_value = response
55
56 def set_sequential_responses(self, responses: list[ChatCompletion]):
57 """
58 Set the mock to return different responses sequentially.
59 :param responses: A list of ChatCompletion responses to return in order.
60 """
61 self.chat.completions.create.side_effect = responses
62
63 def assert_create_called_with(self, **kwargs):
64 self.chat.completions.create.assert_called_with(**kwargs)

Callers 4

test_tool_callFunction · 0.80
test_execute_tools_falseFunction · 0.80
test_handoffFunction · 0.80
mock_client.pyFile · 0.80

Calls

no outgoing calls

Tested by 3

test_tool_callFunction · 0.64
test_execute_tools_falseFunction · 0.64
test_handoffFunction · 0.64