mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
feat(utils.py): support cost tracking for openai/azure image gen models
This commit is contained in:
parent
1661526d97
commit
ef0171e063
5 changed files with 125 additions and 8 deletions
|
@ -1079,7 +1079,7 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
|
|||
metadata = (
|
||||
litellm_params.get("metadata", {}) or {}
|
||||
) # if litellm_params['metadata'] == None
|
||||
call_type = kwargs.get("call_type", "litellm.completion")
|
||||
call_type = kwargs.get("call_type")
|
||||
cache_hit = kwargs.get("cache_hit", False)
|
||||
usage = response_obj["usage"]
|
||||
if type(usage) == litellm.Usage:
|
||||
|
@ -1118,6 +1118,7 @@ def get_logging_payload(kwargs, response_obj, start_time, end_time):
|
|||
"completion_tokens": usage.get("completion_tokens", 0),
|
||||
}
|
||||
|
||||
verbose_proxy_logger.debug(f"SpendTable: created payload - payload: {payload}\n\n")
|
||||
json_fields = [
|
||||
field
|
||||
for field, field_type in LiteLLM_SpendLogs.__annotations__.items()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue