From 90df061ffb0140f46d77de0af99f67ef38e76cdb Mon Sep 17 00:00:00 2001 From: Toni Engelhardt Date: Thu, 14 Sep 2023 10:27:19 +0100 Subject: [PATCH] add kwargs to mock_completion Allows replacing `completion` with `mock_completion` without encountering errors. --- litellm/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/main.py b/litellm/main.py index 46129c7be2..575a49f0dc 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -952,7 +952,7 @@ def batch_completion( return results ## Use this in your testing pipeline, if you need to mock an LLM response -def mock_completion(model: str, messages: List, stream: bool = False, mock_response: str = "This is a mock request"): +def mock_completion(model: str, messages: List, stream: bool = False, mock_response: str = "This is a mock request", **kwargs): try: model_response = ModelResponse() if stream: # return a generator object, iterate through the text in chunks of 3 char / chunk