Merge pull request #32 from marxoffice/master

Fix the wrong price for gpt3.5
This commit is contained in:
Shunyu Yao 2023-06-24 23:19:38 -04:00 committed by GitHub
commit 4fd0a126fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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}