mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-21 22:54:52 +01:00
improved get_current_cost()
This commit is contained in:
committed by
AlexHTW
parent
3066c60894
commit
af7e35bb69
@@ -249,7 +249,7 @@ class UsageTracker:
|
||||
cost_month = 0.0
|
||||
# add to all_time cost, initialize with calculation of total_cost if key doesn't exist
|
||||
cost_all_time = self.usage["current_cost"].get("all_time", self.initialize_all_time_cost())
|
||||
return cost_day, cost_month#, cost_all_time
|
||||
return {"cost_today": cost_day, "cost_month": cost_month, "cost_all_time": cost_all_time}
|
||||
|
||||
def initialize_all_time_cost(self, tokens_price=0.002, image_prices="0.016,0.018,0.02", minute_price=0.006):
|
||||
"""Get total USD amount of all requests in history
|
||||
|
||||
Reference in New Issue
Block a user