-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(plus): add AI Help backend #230
Conversation
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has merge conflicts that must be resolved before it can be merged. |
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.
Nothing major, a few small things:
use crate::db::schema::ai_help_limits::*; | ||
use crate::settings::SETTINGS; | ||
|
||
pub const AI_HELP_LIMIT: i64 = 5; |
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.
Should this perhaps also be a setting?
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.
Happy to make it a settings once the setting isn't optional. I'd like to keep the lazy consts to minimal for now.
} else { | ||
let current = create_or_increment_limit(&mut conn, &user)?; | ||
if current.is_none() { | ||
return Ok(Either::Right(HttpResponse::Ok().json(json!(null)))); |
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.
Should this be https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429?
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.
Bigger decision on how we use status codes. I think right now we mostly use the payload to communicate.
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.
lgtm! 🚀
Avoids errors when there is not enough capacity.
Adding OpenAI and Supabase integration.