Skip to content
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

Support GPT4All server api #11870 #12078

Merged
merged 27 commits into from
Oct 27, 2024

Conversation

NoahXu718
Copy link
Contributor

@NoahXu718 NoahXu718 commented Oct 24, 2024

Closes #11870

Describe the changes you have made here: what, why, ...

What change:

  1. fixed the response cutoff bug, and now the response from the local model should be complete.
    res2

  2. Add Gpt4All choice in ai provider, use this option to use the local model.
    choice

  3. disable the API key text field when using the local model.
    disable

Why:

  1. Users need complete responses when chatting with ai model.
  2. local model provider should not be public providers like openai, which will cause misunderstanding.
  3. local models don't need an API key when sending request, which means users doesn't need to input the API key.

Mandatory checks

  • I own the copyright of the code submitted and I licence it under the MIT license
  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@Siedlerchr Siedlerchr requested a review from InAnYan October 24, 2024 14:32
@NoahXu718 NoahXu718 requested a review from koppor October 25, 2024 10:38
@koppor
Copy link
Member

koppor commented Oct 25, 2024

@NoahXu718 @InAnYan Should be the reviewer here, because he added the AI feature to JabRef.

@InAnYan
Copy link
Collaborator

InAnYan commented Oct 25, 2024

Thanks for mentioning, Oliver!

@InAnYan
Copy link
Collaborator

InAnYan commented Oct 25, 2024

Nice job, NoahXu718! There are lots of things to do to add a new provider.

And it's super cool that you disabled API key for gpt4all.

But I'll review the code a little bit later

koppor
koppor previously requested changes Oct 25, 2024
Copy link
Member

@koppor koppor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small code comments to enable Ruslan to focus on the content.

CHANGELOG.md Outdated Show resolved Hide resolved
src/main/java/org/jabref/gui/preferences/ai/AiTab.java Outdated Show resolved Hide resolved
Comment on lines 67 to 68
// langchainChatModel = Optional.of(new JvmOpenAiChatLanguageModel(aiPreferences, httpClient));
// System.out.println("a");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? Just remove this code.

@NoahXu718 NoahXu718 requested a review from koppor October 25, 2024 13:31
Copy link
Collaborator

@InAnYan InAnYan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I left some moments to change.

And yeah, use GPT4All instead of Chat4All

@NoahXu718 NoahXu718 requested a review from ThiloteE October 25, 2024 17:06
@NoahXu718 NoahXu718 requested a review from InAnYan October 25, 2024 17:44
…g BLANK when the model name is not specified
@NoahXu718 NoahXu718 requested a review from InAnYan October 26, 2024 08:35
@NoahXu718
Copy link
Contributor Author

I think everything has worked well. Could you please check if this pull request can be approved? @InAnYan

@koppor
Copy link
Member

koppor commented Oct 26, 2024

I think everything has worked well. Could you please check if this pull request can be approved? @InAnYan

Did you see the comments? #12078 (comment)

Please use the "Files" tab to check if the comments are addressed by you.

Copy link
Collaborator

@InAnYan InAnYan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only small changes, everything is good!

src/main/java/org/jabref/gui/preferences/ai/AiTab.java Outdated Show resolved Hide resolved
@NoahXu718 NoahXu718 requested a review from InAnYan October 26, 2024 16:08
CHANGELOG.md Show resolved Hide resolved
- Add AI preferences section to changelog
- Add AI providers to changelog
@Siedlerchr Siedlerchr enabled auto-merge October 27, 2024 13:08
@Siedlerchr Siedlerchr dismissed stale reviews from InAnYan and koppor October 27, 2024 13:10

fixed

@Siedlerchr Siedlerchr added this pull request to the merge queue Oct 27, 2024
Merged via the queue into JabRef:main with commit 69c7e21 Oct 27, 2024
23 checks passed
@ThiloteE
Copy link
Member

@NoahXu718 Thank you for your contribution and all the effort! The feature still needs a little work, but we are getting there! :-)

@ThiloteE ThiloteE changed the title Support gpt4 all server api #11870 Support GPT4All server api #11870 Nov 6, 2024
@ThiloteE ThiloteE mentioned this pull request Nov 6, 2024
4 tasks
@ThiloteE ThiloteE added the component: ai Related to AI Chat/Summarization label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ai Related to AI Chat/Summarization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support GPT4All Server API
7 participants