mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
\fix(logging): keep uncomputed hidden cost silent while falling through to calculator"
This commit is contained in:
parent
59c53898da
commit
e4da6304f2
1 changed files with 10 additions and 1 deletions
|
|
@ -2405,7 +2405,16 @@ class Logging(LiteLLMLoggingBaseClass):
|
|||
# Do not preserve 0 from failure_handler on intermediate router retries.
|
||||
pass
|
||||
else:
|
||||
self.model_call_details["response_cost"] = self._response_cost_calculator(result=logging_result)
|
||||
if "response_cost" in hidden_params:
|
||||
warned = self.zero_cost_warned
|
||||
self.zero_cost_warned = True
|
||||
try:
|
||||
self.model_call_details["response_cost"] = self._response_cost_calculator(result=logging_result)
|
||||
finally:
|
||||
self.model_call_details["zero_cost_diagnostic"] = None
|
||||
self.zero_cost_warned = warned
|
||||
else:
|
||||
self.model_call_details["response_cost"] = self._response_cost_calculator(result=logging_result)
|
||||
|
||||
if not build_logging_payload:
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue