-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add notification when quota exceeded #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0eaf312 to
42b2fd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds notification functionality to alert users when their OpenAI API quota is exceeded. The notification system provides specific messaging for different quota types (text, image, transcription, speech) and includes a link to the user's AI settings page.
- Implements a notification system for quota exceeded scenarios
- Creates a new Notifier class to handle notification preparation and display
- Modifies the quota checking logic to trigger notifications when limits are reached
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/Service/OpenAiAPIService.php | Modified quota checking to create and send notifications when quota is exceeded |
| lib/Notification/Notifier.php | New notifier class that formats and prepares quota exceeded notifications |
| lib/AppInfo/Application.php | Registered the new notifier service in the application |
Signed-off-by: Lukas Schaefer <[email protected]>
42b2fd7 to
71f29df
Compare
kyteinsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, this approach is indeed better.
Signed-off-by: Lukas Schaefer <[email protected]>
Signed-off-by: Lukas Schaefer <[email protected]>
Signed-off-by: Lukas Schaefer <[email protected]>
8f4c890 to
4026c0b
Compare
kyteinsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
would you mind organizing your commits into two parts? The second one becuase it affects more than quota related changes.
"feat: add notification when quota exceeded" and "chore: use ocp server get"
or you can merge the whole commit as one using the squash button here in github.
the incremental changes in different commits is nice for PRs but when looking back, you see individual commits and comments in code.
Discussed to be a background job, but I think it would probably be better to notify when the quota is exceeded as this is already checked by default. This also means that the assistant error has more information when the quota is exceeded in a separate notification.
Resolves: #200