mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(litellm_logging.py): use 1 cost calc function across response headers + logging integrations
Ensures consistent cost calculation when azure base models are used
This commit is contained in:
parent
d02d3d9712
commit
10b571ca42
3 changed files with 40 additions and 24 deletions
|
@ -1368,15 +1368,7 @@ def client(original_function):
|
|||
optional_params=kwargs,
|
||||
)
|
||||
result._hidden_params["response_cost"] = (
|
||||
litellm.response_cost_calculator(
|
||||
response_object=result,
|
||||
model=getattr(logging_obj, "model", ""),
|
||||
custom_llm_provider=getattr(
|
||||
logging_obj, "custom_llm_provider", None
|
||||
),
|
||||
call_type=getattr(logging_obj, "call_type", "completion"),
|
||||
optional_params=getattr(logging_obj, "optional_params", {}),
|
||||
)
|
||||
logging_obj._response_cost_calculator(result=result)
|
||||
)
|
||||
if (
|
||||
isinstance(result, ModelResponse)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue