Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/openwebui_token_tracking/pipes/base_tracked_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ def _check_limits(
]
max_credits = self.token_tracker.max_credits(user)

raise DailyTokenLimitExceededError(
message = (
f"You've exceeded the daily usage limit ({max_credits} credits) for the paid AI models. "
f"\nYour usage will reset in {_time_to_midnight()}.\n"
f"\nYour usage will reset in {_time_to_midnight()}.\n"
f"If you would like to obtain more credits, please reach out to {os.environ.get('TOKEN_CREDIT_CONTACT_EMAIL', 'rc@dartmouth.edu')}.\n"
f"**IMPORTANT:** You can still use one of the free models (e.g., {free_models[0].name})."
)
if free_models:
message += f"**IMPORTANT:** You can still use one of the free models (e.g., {free_models[0].name})."
raise DailyTokenLimitExceededError(message)

return True

Expand Down