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

@ -694,7 +694,7 @@ def client(original_function):
kwargs["litellm_call_id"] = str(uuid.uuid4())
try:
model = args[0] if len(args) > 0 else kwargs["model"]
except:
except Exception:
model = None
if (
call_type != CallTypes.image_generation.value