From bc691cbbcda1fafe8fe1b930c7d14e017484bb1e Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Mon, 4 Dec 2023 15:19:47 -0800 Subject: [PATCH] (fix) streaming init response_obj as {} --- litellm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 9505addf5b..d3a9b8bb07 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -5125,7 +5125,7 @@ class CustomStreamWrapper: def chunk_creator(self, chunk): model_response = ModelResponse(stream=True, model=self.model) model_response.choices[0].finish_reason = None - response_obj = None + response_obj = {} try: # return this for all models completion_obj = {"content": ""}