Skip to content

Commit 46289f8

Browse files
authored
gpt-3.5-turbo, priced at $0.002 per 1k tokens (#21)
The current formula for cost calculation is not correct for the current pricing for gpt-3.5-turbo so we need to add a zero here to correct the calculation from .02 to .002 per 1000 tokens. https://openai.com/pricing
1 parent b71f983 commit 46289f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paperqa/docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def _query(
361361
formatted_answer = f"Question: {query}\n\n{answer_text}\n"
362362
if len(bib) > 0:
363363
formatted_answer += f"\nReferences\n\n{bib_str}\n"
364-
formatted_answer += f"\nTokens Used: {tokens} Cost: ${tokens/1000 * 0.02:.2f}"
364+
formatted_answer += f"\nTokens Used: {tokens} Cost: ${tokens/1000 * 0.002:.2f}"
365365
answer.answer = answer_text
366366
answer.formatted_answer = formatted_answer
367367
answer.references = bib_str

0 commit comments

Comments
 (0)