From 888f35a2300cb832e978d630365a360bfb684de6 Mon Sep 17 00:00:00 2001 From: InAnYan Date: Tue, 10 Sep 2024 12:27:13 +0300 Subject: [PATCH] Fix bugs --- PRIVACY.md | 77 ++++++++++--------- .../privacynotice/PrivacyNoticeComponent.fxml | 9 +++ .../privacynotice/PrivacyNoticeComponent.java | 10 ++- .../gui/preferences/ai/AiTabViewModel.java | 22 +++--- src/main/resources/l10n/JabRef_en.properties | 1 + 5 files changed, 67 insertions(+), 52 deletions(-) diff --git a/PRIVACY.md b/PRIVACY.md index 853f5371530..660e2dda512 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -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/) | | -| [ACS Publications](https://pubs.acs.org/) | | -| [APS Advancing Physics](https://harvest.aps.org/) | | -| [arXiv.org](https://arxiv.org/) | | -| [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | | -| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | | +| Service | Privacy Policy | +|---------------------------------------------------------------------------------------------------------------------------|----------------| +| [ACM](https://www.acm.org/) | | +| [ACS Publications](https://pubs.acs.org/) | | +| [APS Advancing Physics](https://harvest.aps.org/) | | +| [arXiv.org](https://arxiv.org/) | | +| [Bibliotheksverbund Bayern](https://www.bib-bvb.de/) | | +| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | | | [Collection of Computer Science Bibliographies](https://en.wikipedia.org/wiki/Collection_of_Computer_Science_Bibliographies) | **currently unavailable**, offline | -| [CrossRef](https://www.crossref.org/) | | -| [dblp](https://dblp.uni-trier.de/) | | -| [DJL (Deep Java Library)](https://djl.ai/) | | -| [Directory of Open Access Books](https://www.doabooks.org/) | | -| [Digitala Vetenskapliga Arkivet](https://www.diva-portal.org/) | | -| [DOI Foundation](https://www.doi.org/) | | -| [Elsevier](https://www.elsevier.com/) | | -| [Google Scholar](https://scholar.google.com/) | | -| [Gemeinsamer Verbundkatalog](https://www.gbv.de/) | | -| [Hugging Face](https://huggingface.co/) | | -| [IACR](https://www.iacr.org/) | | -| [IEEEXplore](https://ieeexplore.ieee.org/Xplore/home.jsp) | | -| [INSPIRE](https://inspirehep.net/) | | -| [ISIDORE](https://isidore.science/) | | -| [JSTOR](https://www.jstor.org/) | | -| [Library of Congress](https://lccn.loc.gov/) | | -| [Mistral AI](https://mistral.ai/) | | -| [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | | -| [MathSciNet](http://www.ams.org/mathscinet) | | -| [mEDRA](https://www.medra.org/) | | -| [Mr. DLib](https://mr-dlib.org/) [1] | | -| [OpenAI](https://openai.com/) | | -| [Openlibrary](https://openlibrary.org) | | -| [ResearchGate](https://www.researchgate.net/) | | -| [IETF Datatracker](https://datatracker.ietf.org/) | | -| [Semantic Scholar](https://www.semanticscholar.org/), powered by [Allen Institute for AI](https://allenai.org/) | | -| [Springer Nature](https://dev.springernature.com/) | | -| [The SAO/NASA Astrophysics Data System](https://ui.adsabs.harvard.edu/) | | -| [Unpaywall](https://unpaywall.org/) | | -| [zbMATH Open](https://www.zbmath.org) | | +| [CrossRef](https://www.crossref.org/) | | +| [dblp](https://dblp.uni-trier.de/) | | +| [DJL (Deep Java Library)](https://djl.ai/) | | +| [Directory of Open Access Books](https://www.doabooks.org/) | | +| [Digitala Vetenskapliga Arkivet](https://www.diva-portal.org/) | | +| [DOI Foundation](https://www.doi.org/) | | +| [Elsevier](https://www.elsevier.com/) | | +| [Google Gemini](https://ai.google.dev/gemini-api) | | +| [Google Scholar](https://scholar.google.com/) | | +| [Gemeinsamer Verbundkatalog](https://www.gbv.de/) | | +| [Hugging Face](https://huggingface.co/) | | +| [IACR](https://www.iacr.org/) | | +| [IEEEXplore](https://ieeexplore.ieee.org/Xplore/home.jsp) | | +| [INSPIRE](https://inspirehep.net/) | | +| [ISIDORE](https://isidore.science/) | | +| [JSTOR](https://www.jstor.org/) | | +| [Library of Congress](https://lccn.loc.gov/) | | +| [Mistral AI](https://mistral.ai/) | | +| [National Library of Medicine](https://www.ncbi.nlm.nih.gov/) | | +| [MathSciNet](http://www.ams.org/mathscinet) | | +| [mEDRA](https://www.medra.org/) | | +| [Mr. DLib](https://mr-dlib.org/) [1] | | +| [OpenAI](https://openai.com/) | | +| [Openlibrary](https://openlibrary.org) | | +| [ResearchGate](https://www.researchgate.net/) | | +| [IETF Datatracker](https://datatracker.ietf.org/) | | +| [Semantic Scholar](https://www.semanticscholar.org/), powered by [Allen Institute for AI](https://allenai.org/) | | +| [Springer Nature](https://dev.springernature.com/) | | +| [The SAO/NASA Astrophysics Data System](https://ui.adsabs.harvard.edu/) | | +| [Unpaywall](https://unpaywall.org/) | | +| [zbMATH Open](https://www.zbmath.org) | | [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).* diff --git a/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.fxml b/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.fxml index 91984a61731..fe8628766a1 100644 --- a/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.fxml +++ b/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.fxml @@ -44,6 +44,15 @@ + + + + + + + + + diff --git a/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java b/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java index cb257d4cf80..d8b4351097e 100644 --- a/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java +++ b/src/main/java/org/jabref/gui/ai/components/privacynotice/PrivacyNoticeComponent.java @@ -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; @@ -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; @@ -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); diff --git a/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java b/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java index 6120b2c532d..995fb277a21 100644 --- a/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/ai/AiTabViewModel.java @@ -279,27 +279,27 @@ public AiTabViewModel(PreferencesService preferencesService) { @Override public void setValues() { - enableAi.setValue(aiPreferences.getEnableAi()); - - selectedAiProvider.setValue(aiPreferences.getAiProvider()); - - openAiChatModel.setValue(aiPreferences.getOpenAiChatModel()); - mistralAiChatModel.setValue(aiPreferences.getMistralAiChatModel()); - geminiChatModel.setValue(aiPreferences.getGeminiChatModel()); - huggingFaceChatModel.setValue(aiPreferences.getHuggingFaceChatModel()); - openAiApiKey.setValue(aiPreferences.getApiKeyForAiProvider(AiProvider.OPEN_AI)); mistralAiApiKey.setValue(aiPreferences.getApiKeyForAiProvider(AiProvider.MISTRAL_AI)); geminiAiApiKey.setValue(aiPreferences.getApiKeyForAiProvider(AiProvider.GEMINI)); huggingFaceApiKey.setValue(aiPreferences.getApiKeyForAiProvider(AiProvider.HUGGING_FACE)); - customizeExpertSettings.setValue(aiPreferences.getCustomizeExpertSettings()); - openAiApiBaseUrl.setValue(aiPreferences.getOpenAiApiBaseUrl()); mistralAiApiBaseUrl.setValue(aiPreferences.getMistralAiApiBaseUrl()); geminiApiBaseUrl.setValue(aiPreferences.getGeminiApiBaseUrl()); huggingFaceApiBaseUrl.setValue(aiPreferences.getHuggingFaceApiBaseUrl()); + openAiChatModel.setValue(aiPreferences.getOpenAiChatModel()); + mistralAiChatModel.setValue(aiPreferences.getMistralAiChatModel()); + geminiChatModel.setValue(aiPreferences.getGeminiChatModel()); + huggingFaceChatModel.setValue(aiPreferences.getHuggingFaceChatModel()); + + enableAi.setValue(aiPreferences.getEnableAi()); + + selectedAiProvider.setValue(aiPreferences.getAiProvider()); + + customizeExpertSettings.setValue(aiPreferences.getCustomizeExpertSettings()); + selectedEmbeddingModel.setValue(aiPreferences.getEmbeddingModel()); instruction.setValue(aiPreferences.getInstruction()); temperature.setValue(LocalizedNumbers.doubleToString(aiPreferences.getTemperature())); diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 990890c3fc4..6af82df342c 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2632,6 +2632,7 @@ Generating\ embeddings\ for\ %0=Generating embeddings for %0 RAG\ minimum\ score\ must\ be\ a\ number=RAG minimum score must be a number RAG\ minimum\ score\ must\ be\ greater\ than\ 0\ and\ less\ than\ 1=RAG minimum score must be greater than 0 and less than 1 Temperature\ must\ be\ a\ number=Temperature must be a number +If\ you\ have\ chosen\ the\ Google\ Gemini\ as\ AI\ provider,\ the\ privacy\ policy\ of\ Google\ Gemini\ applies.\ You\ find\ it\ at\ %0.=If you have chosen the Google Gemini as AI provider, the privacy policy of Google Gemini applies. You find it at %0. Link=Link Source\ URL=Source URL