forked from phoenix/litellm-mirror
(feat) cost: azure gpt + testing
This commit is contained in:
parent
90a9116a17
commit
bb00595429
2 changed files with 28 additions and 2 deletions
|
@ -1678,7 +1678,7 @@ def completion_cost(
|
|||
# get input/output tokens from completion_response
|
||||
prompt_tokens = completion_response['usage']['prompt_tokens']
|
||||
completion_tokens = completion_response['usage']['completion_tokens']
|
||||
model = completion_response['model'] # get model from completion_response
|
||||
model = model or completion_response['model'] # check if user passed an override for model, if it's none check completion_response['model']
|
||||
else:
|
||||
prompt_tokens = token_counter(model=model, text=prompt)
|
||||
completion_tokens = token_counter(model=model, text=completion)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue