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

Add Gemini LLM #11736

Merged
merged 6 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 39 additions & 38 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,46 @@ These third parties may log additional information besides your IP address and t

These third-party services are the following:

| Service | Privacy Policy |
|------------------------------------------------------------------------------------------------------------------------------|----------------|
| [ACM](https://www.acm.org/) | <https://www.acm.org/privacy-policy> |
| [ACS Publications](https://pubs.acs.org/) | <https://www.acs.org/privacy.html> |
| [APS Advancing Physics](https://harvest.aps.org/) | <https://www.aps.org/about/privacy.cfm#privacy> |
| [arXiv.org](https://arxiv.org/) | <https://info.arxiv.org/help/policies/privacy_policy.html> |
| [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | <https://www.bib-bvb.de/web/guest/datenschutzerklaerung-bvb-homepage> |
| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | <https://www.si.edu/Privacy> |
| Service | Privacy Policy |
|---------------------------------------------------------------------------------------------------------------------------|----------------|
| [ACM](https://www.acm.org/) | <https://www.acm.org/privacy-policy> |
| [ACS Publications](https://pubs.acs.org/) | <https://www.acs.org/privacy.html> |
| [APS Advancing Physics](https://harvest.aps.org/) | <https://www.aps.org/about/privacy.cfm#privacy> |
| [arXiv.org](https://arxiv.org/) | <https://info.arxiv.org/help/policies/privacy_policy.html> |
| [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | <https://www.bib-bvb.de/web/guest/datenschutzerklaerung-bvb-homepage> |
| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | <https://www.si.edu/Privacy> |
| [Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies) | **currently unavailable**, offline |
| [CrossRef](https://www.crossref.org/) | <https://www.crossref.org/operations-and-sustainability/privacy/> |
| [dblp](https://dblp.uni-trier.de/) | <https://dblp.uni-trier.de/db/about/privacy.html> |
| [DJL (Deep Java Library)](https://djl.ai/) | <https://github.com/deepjavalibrary/djl/discussions/3370#discussioncomment-10233632> |
| [Directory of Open Access Books](https://www.doabooks.org/) | <https://www.doabooks.org/en/resources/accessibility> |
| [Digitala Vetenskapliga Arkivet](https://www.diva-portal.org/) | <https://www.uu.se/en/about-uu/data-protection-policy/> |
| [DOI Foundation](https://www.doi.org/) | <https://www.doi.org/privacy-policy/> |
| [Elsevier](https://www.elsevier.com/) | <https://www.elsevier.com/legal/privacy-policy> |
| [Google Scholar](https://scholar.google.com/) | <https://policies.google.com/privacy> |
| [Gemeinsamer Verbundkatalog](https://www.gbv.de/) | <https://www.gbv.de/datenschutz> |
| [Hugging Face](https://huggingface.co/) | <https://huggingface.co/privacy> |
| [IACR](https://www.iacr.org/) | <https://www.iacr.org/privacy.html> |
| [IEEEXplore](https://ieeexplore.ieee.org/Xplore/home.jsp) | <https://www.ieee.org/security-privacy.html> |
| [INSPIRE](https://inspirehep.net/) | <https://cern.service-now.com/service-portal?id=privacy_policy&se=INSPIRE-Online&notice=main> |
| [ISIDORE](https://isidore.science/) | <https://isidore.science/credit> |
| [JSTOR](https://www.jstor.org/) | <https://www.ithaka.org/privacypolicy/> |
| [Library of Congress](https://lccn.loc.gov/) | <https://www.loc.gov/legal/> |
| [Mistral AI](https://mistral.ai/) | <https://mistral.ai/terms/#privacy-policy> |
| [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | <https://www.nlm.nih.gov/web_policies.html> |
| [MathSciNet](http://www.ams.org/mathscinet) | <https://www.ams.org/about-us/privacy> |
| [mEDRA](https://www.medra.org/) | <https://www.medra.org/stdoc/en/Servizio_DOI_Informativa_ENG.pdf> |
| [Mr. DLib](https://mr-dlib.org/) [1] | <https://support.dataverse.harvard.edu/harvard-dataverse-privacy-policy> |
| [OpenAI](https://openai.com/) | <https://openai.com/policies/privacy-policy/> |
| [Openlibrary](https://openlibrary.org) | <https://archive.org/about/terms.php> |
| [ResearchGate](https://www.researchgate.net/) | <https://www.researchgate.net/privacy-policy> |
| [IETF Datatracker](https://datatracker.ietf.org/) | <https://www.ietf.org/privacy-statement/> |
| [Semantic Scholar](https://www.semanticscholar.org/), powered by [Allen Institute for AI](https://allenai.org/) | <https://allenai.org/privacy-policy> |
| [Springer Nature](https://dev.springernature.com/) | <https://dev.springernature.com/privacy-policy/> |
| [The SAO/NASA Astrophysics Data System](https://ui.adsabs.harvard.edu/) | <https://ui.adsabs.harvard.edu/help/privacy/> |
| [Unpaywall](https://unpaywall.org/) | <https://unpaywall.org/legal/privacy> |
| [zbMATH Open](https://www.zbmath.org) | <https://zbmath.org/privacy-policy/> |
| [CrossRef](https://www.crossref.org/) | <https://www.crossref.org/operations-and-sustainability/privacy/> |
| [dblp](https://dblp.uni-trier.de/) | <https://dblp.uni-trier.de/db/about/privacy.html> |
| [DJL (Deep Java Library)](https://djl.ai/) | <https://github.com/deepjavalibrary/djl/discussions/3370#discussioncomment-10233632> |
| [Directory of Open Access Books](https://www.doabooks.org/) | <https://www.doabooks.org/en/resources/accessibility> |
| [Digitala Vetenskapliga Arkivet](https://www.diva-portal.org/) | <https://www.uu.se/en/about-uu/data-protection-policy/> |
| [DOI Foundation](https://www.doi.org/) | <https://www.doi.org/privacy-policy/> |
| [Elsevier](https://www.elsevier.com/) | <https://www.elsevier.com/legal/privacy-policy> |
| [Google Gemini](https://ai.google.dev/gemini-api) | <https://ai.google.dev/gemini-api/terms> |
| [Google Scholar](https://scholar.google.com/) | <https://policies.google.com/privacy> |
| [Gemeinsamer Verbundkatalog](https://www.gbv.de/) | <https://www.gbv.de/datenschutz> |
| [Hugging Face](https://huggingface.co/) | <https://huggingface.co/privacy> |
| [IACR](https://www.iacr.org/) | <https://www.iacr.org/privacy.html> |
| [IEEEXplore](https://ieeexplore.ieee.org/Xplore/home.jsp) | <https://www.ieee.org/security-privacy.html> |
| [INSPIRE](https://inspirehep.net/) | <https://cern.service-now.com/service-portal?id=privacy_policy&se=INSPIRE-Online&notice=main> |
| [ISIDORE](https://isidore.science/) | <https://isidore.science/credit> |
| [JSTOR](https://www.jstor.org/) | <https://www.ithaka.org/privacypolicy/> |
| [Library of Congress](https://lccn.loc.gov/) | <https://www.loc.gov/legal/> |
| [Mistral AI](https://mistral.ai/) | <https://mistral.ai/terms/#privacy-policy> |
| [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | <https://www.nlm.nih.gov/web_policies.html> |
| [MathSciNet](http://www.ams.org/mathscinet) | <https://www.ams.org/about-us/privacy> |
| [mEDRA](https://www.medra.org/) | <https://www.medra.org/stdoc/en/Servizio_DOI_Informativa_ENG.pdf> |
| [Mr. DLib](https://mr-dlib.org/) [1] | <https://support.dataverse.harvard.edu/harvard-dataverse-privacy-policy> |
| [OpenAI](https://openai.com/) | <https://openai.com/policies/privacy-policy/> |
| [Openlibrary](https://openlibrary.org) | <https://archive.org/about/terms.php> |
| [ResearchGate](https://www.researchgate.net/) | <https://www.researchgate.net/privacy-policy> |
| [IETF Datatracker](https://datatracker.ietf.org/) | <https://www.ietf.org/privacy-statement/> |
| [Semantic Scholar](https://www.semanticscholar.org/), powered by [Allen Institute for AI](https://allenai.org/) | <https://allenai.org/privacy-policy> |
| [Springer Nature](https://dev.springernature.com/) | <https://dev.springernature.com/privacy-policy/> |
| [The SAO/NASA Astrophysics Data System](https://ui.adsabs.harvard.edu/) | <https://ui.adsabs.harvard.edu/help/privacy/> |
| [Unpaywall](https://unpaywall.org/) | <https://unpaywall.org/legal/privacy> |
| [zbMATH Open](https://www.zbmath.org) | <https://zbmath.org/privacy-policy/> |

[1]: *Note: The Mr. DLib service is used for the related articles tab in the entry editor and collects also your language, your browser and operating system (*disabled* by default).*

Expand Down
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,13 @@ dependencies {
implementation 'org.yaml:snakeyaml:2.3'

// AI
implementation 'dev.langchain4j:langchain4j:0.33.0'
implementation 'dev.langchain4j:langchain4j:0.34.0'
// Even though we use jvm-openai for LLM connection, we still need this package for tokenization.
implementation('dev.langchain4j:langchain4j-open-ai:0.33.0') {
implementation('dev.langchain4j:langchain4j-open-ai:0.34.0') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
implementation('dev.langchain4j:langchain4j-mistral-ai:0.33.0')
implementation('dev.langchain4j:langchain4j-mistral-ai:0.34.0')
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.34.0')
implementation('dev.langchain4j:langchain4j-hugging-face:0.34.0')
implementation 'ai.djl:api:0.29.0'
implementation 'ai.djl.pytorch:pytorch-model-zoo:0.29.0'
Expand Down
1 change: 1 addition & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,6 @@
requires mslinks;
requires org.antlr.antlr4.runtime;
requires org.libreoffice.uno;
requires langchain4j.google.ai.gemini;
// endregion
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
</Text>
</children>
</TextFlow>
<TextFlow fx:id="geminiPrivacyTextFlow">
<children>
<Text text="%If you have chosen the Google Gemini as AI provider, the privacy policy of Google Gemini applies. You find it at %0.">
Copy link
Member

Choose a reason for hiding this comment

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

Can't we unify the l10n here and add the name of the AI provider as a parameter as well?
If you have chosen %0 as AI provider, the privacy policy of Google Gemini applies. You find it at %1.">

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

image

OMG! All of this time, when user clicks on privacy policy of an AI provider, they're sent to API URL!

Ahah, I'll fix this

<font>
<Font size="14.0" />
</font>
</Text>
</children>
</TextFlow>
<TextFlow fx:id="huggingFacePrivacyTextFlow">
<children>
<Text text="%If you have chosen the Hugging Face as AI provider, the privacy policy of Hugging Face applies. You find it at %0.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

import org.jabref.gui.DialogService;
import org.jabref.gui.desktop.JabRefDesktop;
import org.jabref.logic.ai.AiDefaultPreferences;
import org.jabref.preferences.FilePreferences;
import org.jabref.preferences.ai.AiPreferences;
import org.jabref.preferences.ai.AiProvider;

import com.airhacks.afterburner.views.ViewLoader;
import org.slf4j.Logger;
Expand All @@ -22,6 +24,7 @@ public class PrivacyNoticeComponent extends ScrollPane {

@FXML private TextFlow openAiPrivacyTextFlow;
@FXML private TextFlow mistralAiPrivacyTextFlow;
@FXML private TextFlow geminiPrivacyTextFlow;
@FXML private TextFlow huggingFacePrivacyTextFlow;
@FXML private Text embeddingModelText;

Expand All @@ -43,9 +46,10 @@ public PrivacyNoticeComponent(AiPreferences aiPreferences, Runnable onIAgreeButt

@FXML
private void initialize() {
initPrivacyHyperlink(openAiPrivacyTextFlow, "https://openai.com/policies/privacy-policy/");
initPrivacyHyperlink(mistralAiPrivacyTextFlow, "https://mistral.ai/terms/#privacy-policy");
initPrivacyHyperlink(huggingFacePrivacyTextFlow, "https://huggingface.co/privacy");
initPrivacyHyperlink(openAiPrivacyTextFlow, AiDefaultPreferences.PROVIDERS_API_URLS.get(AiProvider.OPEN_AI));
initPrivacyHyperlink(mistralAiPrivacyTextFlow, AiDefaultPreferences.PROVIDERS_API_URLS.get(AiProvider.MISTRAL_AI));
initPrivacyHyperlink(geminiPrivacyTextFlow, AiDefaultPreferences.PROVIDERS_API_URLS.get(AiProvider.GEMINI));
initPrivacyHyperlink(huggingFacePrivacyTextFlow, AiDefaultPreferences.PROVIDERS_API_URLS.get(AiProvider.HUGGING_FACE));

String newEmbeddingModelText = embeddingModelText.getText().replaceAll("%0", aiPreferences.getEmbeddingModel().sizeInfo());
embeddingModelText.setText(newEmbeddingModelText);
Expand Down
Loading
Loading