forked from phoenix/litellm-mirror
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:
parent
dce8e3efb8
commit
aad0bbb08c
1 changed files with 11 additions and 4 deletions
|
@ -735,9 +735,16 @@ def response_cost_calculator(
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
verbose_logger.warning(
|
if litellm.suppress_debug_info: # allow cli tools to suppress this information.
|
||||||
"litellm.cost_calculator.py::response_cost_calculator - Returning None. Exception occurred - {}/n{}".format(
|
verbose_logger.debug(
|
||||||
str(e), traceback.format_exc()
|
"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
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue