mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 19:54:13 +00:00
(feat) cost: azure gpt + testing
This commit is contained in:
parent
440590cf22
commit
288e3e962a
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