-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow users to configure a personal OpenAI API key #1496
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1496 +/- ##
==========================================
+ Coverage 93.77% 93.83% +0.06%
==========================================
Files 122 123 +1
Lines 2955 2985 +30
==========================================
+ Hits 2771 2801 +30
Misses 184 184 ☔ View full report in Codecov by Sentry. |
2974af6
to
5f1ec17
Compare
I managed to add an API key text area for users to input their key. When I edit the profile and add a key and update, its still blank. I am not really sure what I need to do to make it persist. @MrSerth @kkoehn : With the current changes I made, am I on the right track to have each user have their own API key? Once I can persist the update in the profile, the next step will be to actually use that for the unit test generator. I also noticed that the Update: I was able to persist the API key in the user profile by adjusting the |
8180348
to
efe342b
Compare
Good work on figuring out the strong parameters! To use user-specific API-Keys you will have to touch multiple points:
I hope this gives you a way forward, if you need more help, let me know! |
a496065
to
d3b9a89
Compare
Everything should now work as intended. There is only one 'issue' that I can't seem to find a solution for. In the code, I am raising I figured out the issue is in the Currently the task policy says the following:
When removing |
d3b9a89
to
f6874a5
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.
Thanks for the quick work with this PR. It looks good in general and seems to work fine, but I found some points that could be improved and had some questions.
db/migrate/20240702224053_add_personal_openai_api_key_to_users.rb
Outdated
Show resolved
Hide resolved
f6874a5
to
83f30a2
Compare
7748b49
to
a57a16f
Compare
01fda2d
to
3ceb522
Compare
3ceb522
to
80ea72a
Compare
@kkoehn I don't understand why the tests are currently failing. what changed? Could you also help me resolve the conflict, please? I have updated my branch but the conflict still exists. |
dce3b5b
to
e38ea79
Compare
54fee59
to
e1e1d45
Compare
Added tests in user.rb remove redundant code in spec files
e1e1d45
to
eb9b0ea
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.
All of my review points have been addressed. Good work!
- Introduce a common base class - Move error descriptions to dedicated locale - Catch more network-related errors
23c2d40
to
bbe208b
Compare
bbe208b
to
16e70ba
Compare
Having an API key per user will allow users to utilize the AI capabilities within CodeHarbor (i.e. Unittest generator)