From 79ab1aa35b1c90b4acffd1d7c49c2ea4d0336607 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Fri, 5 Jan 2024 11:47:16 +0530 Subject: [PATCH] (fix) undo - model_dump_json() before logging --- litellm/llms/openai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/openai.py b/litellm/llms/openai.py index bf5e4a10c..0299c502c 100644 --- a/litellm/llms/openai.py +++ b/litellm/llms/openai.py @@ -386,13 +386,13 @@ class OpenAIChatCompletion(BaseLLM): response = await openai_aclient.chat.completions.create( **data, timeout=timeout ) + stringified_response = response.model_dump_json() logging_obj.post_call( input=data["messages"], api_key=api_key, - original_response=response, + original_response=stringified_response, additional_args={"complete_input_dict": data}, ) - stringified_response = response.model_dump_json() return convert_to_model_response_object( response_object=json.loads(stringified_response), model_response_object=model_response,