fix(litellm_logging.py): log response_cost=0 for failed calls

Fixes https://github.com/BerriAI/litellm/issues/4604
This commit is contained in:
Krrish Dholakia 2024-07-15 19:25:56 -07:00
parent 9cc2daeec9
commit 959c627dd3
5 changed files with 49 additions and 34 deletions

View file

@ -1499,6 +1499,7 @@ class Logging:
self.model_call_details["traceback_exception"] = traceback_exception
self.model_call_details["end_time"] = end_time
self.model_call_details.setdefault("original_response", None)
self.model_call_details["response_cost"] = 0
return start_time, end_time
def failure_handler(