mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-17 10:26:07 +00:00
fix(cost_calculator.py): respect litellm.suppress_debug_info for cost calc
Fixes https://github.com/BerriAI/litellm/issues/4818#issuecomment-2263795765
This commit is contained in:
@@ -735,9 +735,16 @@ def response_cost_calculator(
|
||||
)
|
||||
return None
|
||||
except Exception as e:
|
||||
verbose_logger.warning(
|
||||
"litellm.cost_calculator.py::response_cost_calculator - Returning None. Exception occurred - {}/n{}".format(
|
||||
str(e), traceback.format_exc()
|
||||
if litellm.suppress_debug_info: # allow cli tools to suppress this information.
|
||||
verbose_logger.debug(
|
||||
"litellm.cost_calculator.py::response_cost_calculator - Returning None. Exception occurred - {}/n{}".format(
|
||||
str(e), traceback.format_exc()
|
||||
)
|
||||
)
|
||||
else:
|
||||
verbose_logger.warning(
|
||||
"litellm.cost_calculator.py::response_cost_calculator - Returning None. Exception occurred - {}/n{}".format(
|
||||
str(e), traceback.format_exc()
|
||||
)
|
||||
)
|
||||
)
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user