Skip to content

Support GPT4All server api #11870#12078

Merged
Siedlerchr merged 27 commits into
JabRef:mainfrom
ShunL12324:Support-GPT4All-Server-API-#11870
Oct 27, 2024
Merged

Support GPT4All server api #11870#12078
Siedlerchr merged 27 commits into
JabRef:mainfrom
ShunL12324:Support-GPT4All-Server-API-#11870

Conversation

@NoahXu718

@NoahXu718 NoahXu718 commented Oct 24, 2024

Copy link
Copy Markdown
Contributor

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
Comment thread src/main/java/org/jabref/logic/ai/chatting/model/Chat4AllModel.java Outdated
@NoahXu718 NoahXu718 requested a review from koppor October 25, 2024 10:38
@koppor

koppor commented Oct 25, 2024

Copy link
Copy Markdown
Member

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

@InAnYan

InAnYan commented Oct 25, 2024

Copy link
Copy Markdown
Member

Thanks for mentioning, Oliver!

@InAnYan

InAnYan commented Oct 25, 2024

Copy link
Copy Markdown
Member

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

@koppor koppor left a comment

Copy link
Copy Markdown
Member

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.

Comment thread CHANGELOG.md Outdated
Comment thread src/main/java/org/jabref/gui/preferences/ai/AiTab.java Outdated
Comment thread src/main/java/org/jabref/logic/ai/chatting/AiChatLogic.java
Comment on lines +67 to +68
// langchainChatModel = Optional.of(new JvmOpenAiChatLanguageModel(aiPreferences, httpClient));
// System.out.println("a");

Copy link
Copy Markdown
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.

Comment thread src/main/java/org/jabref/logic/ai/chatting/model/JvmOpenAiChatLanguageModel.java Outdated
@NoahXu718 NoahXu718 requested a review from koppor October 25, 2024 13:31
Comment thread src/main/java/org/jabref/model/ai/AiProvider.java Outdated
Comment thread src/main/java/org/jabref/model/ai/AiProvider.java

@InAnYan InAnYan left a comment

Copy link
Copy Markdown
Member

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

Comment thread CHANGELOG.md Outdated
Comment thread src/main/java/org/jabref/gui/preferences/ai/AiTab.java
Comment thread src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java Outdated
Comment thread src/main/java/org/jabref/logic/ai/chatting/model/Gpt4AllModel.java
Comment thread src/main/java/org/jabref/model/ai/AiProvider.java
Comment thread src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java Outdated
@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
Copy Markdown
Contributor Author

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

@koppor

koppor commented Oct 26, 2024

Copy link
Copy Markdown
Member

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.

@InAnYan InAnYan left a comment

Copy link
Copy Markdown
Member

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!

Comment thread src/main/java/org/jabref/gui/preferences/ai/AiTab.java Outdated
Comment thread src/main/java/org/jabref/logic/ai/AiDefaultPreferences.java Outdated
@NoahXu718 NoahXu718 requested a review from InAnYan October 26, 2024 16:08
Comment thread CHANGELOG.md
- 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
@ThiloteE

Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support GPT4All Server API

7 participants