Set the mock to return a specific response. :param response: A ChatCompletion response to return.
(self, response: ChatCompletion)
| 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 | """ |
no outgoing calls