mirror of
https://github.com/father-bot/chatgpt_telegram_bot.git
synced 2026-06-13 03:54:57 +03:00
Merge pull request #55 from N0ne1eft/pricing-update
Update davinci pricing from 0.01$/K to 0.02$/K to match OpenAI website
This commit is contained in:
+2
-2
@@ -194,10 +194,10 @@ async def show_balance_handle(update: Update, context: CallbackContext):
|
||||
db.set_user_attribute(user_id, "last_interaction", datetime.now())
|
||||
|
||||
n_used_tokens = db.get_user_attribute(user_id, "n_used_tokens")
|
||||
n_spent_dollars = n_used_tokens * (0.01 / 1000)
|
||||
n_spent_dollars = n_used_tokens * (0.02 / 1000)
|
||||
|
||||
text = f"You spent <b>{n_spent_dollars:.03f}$</b>\n"
|
||||
text += f"You used <b>{n_used_tokens}</b> tokens <i>(price: 0.01$ per 1000 tokens)</i>\n"
|
||||
text += f"You used <b>{n_used_tokens}</b> tokens <i>(price: 0.02$ per 1000 tokens)</i>\n"
|
||||
|
||||
await update.message.reply_text(text, parse_mode=ParseMode.HTML)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user