Fix the wrong price for gpt3.5

This commit is contained in:
Rayquaza 2023-06-25 00:13:07 +08:00
parent 03b84431d5
commit 5627a8f0ab
1 changed files with 1 additions and 1 deletions

View File

@ -41,5 +41,5 @@ def gpt_usage(backend="gpt-4"):
if backend == "gpt-4":
cost = completion_tokens / 1000 * 0.06 + prompt_tokens / 1000 * 0.03
elif backend == "gpt-3.5-turbo":
cost = (completion_tokens + prompt_tokens) / 1000 * 0.0002
cost = completion_tokens / 1000 * 0.002 + prompt_tokens / 1000 * 0.0015
return {"completion_tokens": completion_tokens, "prompt_tokens": prompt_tokens, "cost": cost}