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

API token should be fetched later #104

Closed
koppor opened this issue Aug 4, 2024 · 21 comments
Closed

API token should be fetched later #104

koppor opened this issue Aug 4, 2024 · 21 comments
Labels
status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue
Milestone

Comments

@koppor
Copy link
Collaborator

koppor commented Aug 4, 2024

JabRef uses Java Key Ring to connect to password stores.

org.jabref.preferences.JabRefPreferences#getAiPreferences access that key store when creating the AI Chat tab. This leads to following startup error output:

2024-08-04 10:50:20 [JavaFX Application Thread] org.jabref.preferences.JabRefPreferences.getAiApiTokenFromKeyring()
WARN: JabRef could not open keyring for retrieving OpenAI API token: com.github.javakeyring.PasswordAccessException: Error code 1168
        at java.keyring@1.0.4/com.github.javakeyring.internal.windows.WinCredentialStoreBackend.getPassword(WinCredentialStoreBackend.java:61)
        at java.keyring@1.0.4/com.github.javakeyring.Keyring.getPassword(Keyring.java:90)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getAiApiTokenFromKeyring(JabRefPreferences.java:2808)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getAiPreferences(JabRefPreferences.java:2773)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:159)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:90)
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
        at javafx.graphics@22.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        at java.base/java.lang.Thread.run(Thread.java:1583)
2024-08-04 10:50:21 [JavaFX Application Thread] org.jabref.gui.StateManager.setActiveDatabase()

When opening preferences, the key is there.


When using Gnome, on startup, one will be asked to open the key store. This is not necessary. It is necessary when interacting with the AI.

Please postpone the call to org.jabref.preferences.JabRefPreferences#getAiApiTokenFromKeyring to the latest point in time (and store the key internally once retrieved). (OK, one also has to take care if they key is changed by the user)

@koppor koppor added this to the Week 1 milestone Aug 4, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 4, 2024

I'm not sure how to code this properly. This will probably break some symmetry and used practice, but yes, the issue is right.

Can I make org.jabref.preferences.JabRefPreferences#getAiPreferences public?

@koppor
Copy link
Collaborator Author

koppor commented Aug 4, 2024

I'm not sure how to code this properly. This will probably break some symmetry and used practice, but yes, the issue is right.

Maybe, the other places need to be changed "accordingly" (e.g., proxy password, ...). I think, however, that it is OK for JabRef users with proxy passwords that JabRef asks for the password right at the start. For API keys, I am not that sure...

With your changes, an example can be shown how it will work.

Can I make org.jabref.preferences.JabRefPreferences#getAiPreferences public?

Yes. This will lead to another method signature in PreferenceServcid, whcih is OK.

@koppor
Copy link
Collaborator Author

koppor commented Aug 5, 2024

Maybe "Future" helps?

InAnYan added a commit to JabRef/jabref that referenced this issue Aug 6, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 6, 2024

Okay, I think I managed to do this in a recent push

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 6, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 6, 2024

No, see output of gradlew run:

$ ./gradlew run

> Configure project :
Project : => 'org.jabref' Java module

> Task :run
WARNING: Using incubator modules: jdk.incubator.vector
Messages are not initialized before accessing key: Display help on command line options
2024-08-06 17:00:16 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.addStylesheetToWatchlist()
INFO: Watching css C:\git-repositories\jabref-all\jabref\build\resources\main\org\jabref\gui\Base.css for live updates
2024-08-06 17:00:16 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2024-08-06 17:00:16 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{file:/C:/git-repositories/jabref-all/jabref/build/resources/main/org/jabref/gui/Base.css}
2024-08-06 17:00:16 [JavaFX Application Thread] org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider()
WARN: JabRef could not open keyring for retrieving OpenAI API token: com.github.javakeyring.PasswordAccessException: Error code 1168
        at java.keyring@1.0.4/com.github.javakeyring.internal.windows.WinCredentialStoreBackend.getPassword(WinCredentialStoreBackend.java:61)
        at java.keyring@1.0.4/com.github.javakeyring.Keyring.getPassword(Keyring.java:90)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider(JabRefPreferences.java:2855)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getAiPreferences(JabRefPreferences.java:2795)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:159)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:90)
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
        at javafx.graphics@22.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at javafx.graphics@22.0.2/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
        at java.base/java.lang.Thread.run(Thread.java:1583)
2024-08-06 17:00:16 [pool-2-thread-1] org.jabref.logic.ai.models.EmbeddingModel.rebuild()
INFO: Downloading embedding model...
Loading:     100% |========================================|
2024-08-06 17:00:16 [pool-2-thread-1] ai.djl.pytorch.jni.LibUtils.downloadPyTorch()
WARN: No matching cuda flavor for win-x86_64 found: cu065.
2024-08-06 17:00:17 [pool-2-thread-1] ai.djl.pytorch.engine.PtEngine.newInstance()
INFO: PyTorch graph executor optimizer is enabled, this may impact your inference latency and throughput. See: https://docs.djl.ai/docs/development/inference_performance_optimization.html#graph-executor-optimization
2024-08-06 17:00:17 [pool-2-thread-1] ai.djl.pytorch.engine.PtEngine.newInstance()
INFO: Number of inter-op threads is 24
2024-08-06 17:00:17 [pool-2-thread-1] ai.djl.pytorch.engine.PtEngine.newInstance()
INFO: Number of intra-op threads is 12
2024-08-06 17:00:17 [pool-2-thread-1] ai.djl.util.Platform.detectPlatform()
INFO: Found matching platform from: jar:file:///C:/Users/koppor/.gradle/caches/modules-2/files-2.1/ai.djl.huggingface/tokenizers/0.29.0/edd38326d16523f2b8c2b1e360b896e7ae48a1fa/tokenizers-0.29.0.jar!/native/lib/tokenizers.properties
2024-08-06 17:00:17 [JavaFX Application Thread] org.jabref.gui.StateManager.setActiveDatabase()
INFO: No open database detected
2024-08-06 17:00:18 [pool-2-thread-2] org.jabref.gui.JabRefDialogService.notify()
INFO: Opening: 'C:\Users\koppor\OneDrive\Projects\JabRef-AI\Chocolate.bib'
2024-08-06 17:00:18 [JavaFX Application Thread] sun.util.logging.internal.LoggingProviderImpl$JULWrapper.log()
WARN: Resource "" not found.
2024-08-06 17:00:19 [JavaFX Application Thread] sun.util.logging.internal.LoggingProviderImpl$JULWrapper.log()
WARN: Resource "" not found.
2024-08-06 17:00:19 [JavaFX Application Thread] org.jabref.logic.ai.models.EmbeddingModel.lambda$startRebuildingTask$0()
INFO: Embedding model was successfully downloaded
2024-08-06 17:00:19 [JavaFX Application Thread] org.apache.lucene.internal.vectorization.PanamaVectorizationProvider.<init>()
INFO: Java vector incubator API enabled; uses preferredBitSize=256; FMA enabled

@koppor koppor removed the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 6, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 6, 2024

Are you sure you started JabRef without AI-enabled?

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 6, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 6, 2024

I highlight important terms of my issue description:

image

I try TL;DR:

  • AI chat opened: No key -> fetch key from store
  • Entry editor closed -> NO KEY FETCHED !!!!
  • Start of op JabRef -> NO KEY FETCHED !!!!

@koppor koppor removed the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 6, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 6, 2024

If this is too difficult to implement, we can postpone to the famous week 12.

@InAnYan
Copy link
Owner

InAnYan commented Aug 7, 2024

Ah, I see. I just implemented it for:

  1. User opens preferences
  2. Agrees to AI
  3. Saves preferences

And after that the key will be fetched

@InAnYan
Copy link
Owner

InAnYan commented Aug 7, 2024

As I understand, we should fetch the key ONLY when we start chatting or summarizing?

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 7, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 7, 2024

As I understand, we should fetch the key ONLY when we start chatting or summarizing?

Yes.


For the preferences, it is difficult. A "perfect" solution would be follwowing:

Assumption: Password field is write-only

There is no (!) eye icon - thus I cannot read from the field:

grafik

As a consequence, the field is write only.

Question: Should the user know if (s)he entered anything?

  • If yes: Store in preferences if there was a key set. If yes: display password field with arbitrary filled value (user sees dots in all caes)
  • If not: gets even more simpler

After the user changed the text field, the new key is stored in the key store.

No need to read the api key ever in the preferences.

@koppor koppor removed the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 7, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 7, 2024

Note that there is something reading the the AI Preferences - and thus the key:

> Task :run
WARNING: Using incubator modules: jdk.incubator.vector
Messages are not initialized before accessing key: Display help on command line options
2024-08-07 06:27:15 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.addStylesheetToWatchlist()
INFO: Watching css /home/vagrant/jabref/build/resources/main/org/jabref/gui/Base.css for live updates
2024-08-07 06:27:15 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Not updating theme because it hasn't changed
2024-08-07 06:27:15 [JavaFX Application Thread] org.jabref.gui.theme.ThemeManager.updateThemeSettings()
INFO: Theme set to Theme{type=DEFAULT, name=''} with base css StyleSheet{file:/home/vagrant/jabref/build/resources/main/org/jabref/gui/Base.css}
2024-08-07 06:27:15 [JavaFX Application Thread] org.freedesktop.dbus.connections.transports.TransportBuilder.build()
INFO: Using transport dbus-java-transport-native-unixsocket to connect to unix:path=/run/user/1000/bus
2024-08-07 06:27:16 [JavaFX Application Thread] org.freedesktop.secret.handlers.SignalHandler.await()
INFO: Await signal Prompt.Completed(/org/freedesktop/secrets/prompt/u1) within 120 seconds.
2024-08-07 06:27:20 [DBus-Signal-Receiver-1] org.freedesktop.secret.handlers.SignalHandler.handle()
INFO: Received signal Service.CollectionChanged: /org/freedesktop/secrets/collection/login
2024-08-07 06:27:20 [DBus-Signal-Receiver-1] org.freedesktop.secret.handlers.SignalHandler.handle()
INFO: Received signal Prompt.Completed(/org/freedesktop/secrets/prompt/u1): {dismissed: false, result: [[/org/freedesktop/secrets/aliases/default]]}
2024-08-07 06:27:20 [JavaFX Application Thread] org.freedesktop.dbus.connections.transports.TransportBuilder.build()
INFO: Using transport dbus-java-transport-native-unixsocket to connect to unix:path=/run/user/1000/bus
2024-08-07 06:27:20 [JavaFX Application Thread] org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider()
WARN: JabRef could not open keyring for retrieving OpenAI API token: com.github.javakeyring.PasswordAccessException: No stored credentials match org.jabref.ai account: apitoken-MISTRAL_AI
        at java.keyring@1.0.4/com.github.javakeyring.internal.freedesktop.FreedesktopKeyringBackend.throwNoExistingCredentialException(FreedesktopKeyringBackend.java:161)
        at java.keyring@1.0.4/com.github.javakeyring.internal.freedesktop.FreedesktopKeyringBackend.getPassword(FreedesktopKeyringBackend.java:91)
        at java.keyring@1.0.4/com.github.javakeyring.Keyring.getPassword(Keyring.java:90)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider(JabRefPreferences.java:2855)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getAiPreferences(JabRefPreferences.java:2794)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:159)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:90)
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
        at javafx.graphics@22.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at javafx.graphics@22.0.2/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at javafx.graphics@22.0.2/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$10(GtkApplication.java:264)
        at java.base/java.lang.Thread.run(Thread.java:1583)
2024-08-07 06:27:20 [JavaFX Application Thread] org.freedesktop.dbus.connections.transports.TransportBuilder.build()
INFO: Using transport dbus-java-transport-native-unixsocket to connect to unix:path=/run/user/1000/bus
2024-08-07 06:27:20 [JavaFX Application Thread] org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider()
WARN: JabRef could not open keyring for retrieving OpenAI API token: com.github.javakeyring.PasswordAccessException: No stored credentials match org.jabref.ai account: apitoken-HUGGING_FACE
        at java.keyring@1.0.4/com.github.javakeyring.internal.freedesktop.FreedesktopKeyringBackend.throwNoExistingCredentialException(FreedesktopKeyringBackend.java:161)
        at java.keyring@1.0.4/com.github.javakeyring.internal.freedesktop.FreedesktopKeyringBackend.getPassword(FreedesktopKeyringBackend.java:91)
        at java.keyring@1.0.4/com.github.javakeyring.Keyring.getPassword(Keyring.java:90)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getApiKeyForAiProvider(JabRefPreferences.java:2855)
        at org.jabref@100.0.0/org.jabref.preferences.JabRefPreferences.getAiPreferences(JabRefPreferences.java:2795)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.initialize(JabRefGUI.java:159)
        at org.jabref@100.0.0/org.jabref.gui.JabRefGUI.start(JabRefGUI.java:90)
        at javafx.graphics@22.0.2/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:839)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:483)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:456)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at javafx.graphics@22.0.2/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:455)
        at javafx.graphics@22.0.2/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at javafx.graphics@22.0.2/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at javafx.graphics@22.0.2/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$10(GtkApplication.java:264)
        at java.base/java.lang.Thread.run(Thread.java:1583)
2024-08-07 06:27:21 [pool-2-thread-1] org.jabref.logic.ai.models.EmbeddingModel.rebuild()

@koppor
Copy link
Collaborator Author

koppor commented Aug 7, 2024

See my comment JabRef@1d4c383 on a possible code-based solution.

InAnYan added a commit to JabRef/jabref that referenced this issue Aug 7, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 7, 2024

Hope I managed to do this in a recent push

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 7, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 7, 2024

I commented at JabRef#11430 (review) - please refine the code.

@koppor koppor removed the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 7, 2024
InAnYan added a commit to JabRef/jabref that referenced this issue Aug 9, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 9, 2024

I took this approach: I mark unloaded keys as empty strings. If the string is empty, then it will be retrieved from keyring. I think, this is okay?

(You should see a message "InAnYan referenced this issue", above this comment)

About factoring out fields: I wonder, if it's really needed. Currently I only see one purpose - grouping. If it had more complex logic..

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 9, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 9, 2024

Actually, I understood. It would be better to have a separate class for API keys in case there will be more of them. They should be stored in a Map<AiProvider, String>, or something like that

@koppor
Copy link
Collaborator Author

koppor commented Aug 10, 2024

Actually, I understood. It would be better to have a separate class for API keys in case there will be more of them.

Yes!

They should be stored in a Map<AiProvider, String>, or something like that

Yes. The enum org.jabref.preferences.ai.AiProvider is really good.

The label can directly be used as last part of the item name in the java key store.

@koppor koppor removed the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 10, 2024
@InAnYan
Copy link
Owner

InAnYan commented Aug 12, 2024

I wonder, Oliver, if we can make a separate issue for "Refactor support of multiple AI providers", because not only API key is associated with an AI provider.

For now we have a simple fix.

What if I make that issue and close this one (close this - because API token is fetched later)

@InAnYan InAnYan added the status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue label Aug 12, 2024
@koppor
Copy link
Collaborator Author

koppor commented Aug 12, 2024

Go ahead with creating a new issue and closing this (with a reference to the new isssue)

@koppor
Copy link
Collaborator Author

koppor commented Aug 13, 2024

There still was a call to rebuild reading the API key in org.jabref.logic.ai.models.JabRefChatLanguageModel#JabRefChatLanguageModel. Removed at 400d83e.

github-merge-queue bot pushed a commit to JabRef/jabref that referenced this issue Aug 14, 2024
* Fix the code from code review

* Fix from code review and create new AiChatTabWorking

* Improve chat history storage code

* More fix from code review

* Remove obsolete parameter

* Add JavaDoc comment

* Fix checkstyle

* Fix JavaDoc

* Fix more checkstyle

* More checkstyle fixes

* Fix code changes

* Improve the PR

* Rework ADR-0031 to enable to use another option

* Add many LOGGEr.trace statements

* Change "message window" to "context window"

* Fix compiler errors

* Fix issue list index issue of langchain4j

* Fix lint issue

* Update 0031-store-chats-alongside-database.md

* More tracing

* Refine logging

* Remove closing of AiChatLanguageModel (because it's not closable)

* Use external package for OpenAI API connection

* Provide a custom executor for RetrievalAugmentor

* Fix shutdown issue (I hope)

* Refactor classes

* Change BibDatabaseChatHistoryFile

* Revert BibDatabaseChatHistoryFile to old version because of langchain4j

* Make round corners for chat messages

* Refactor embeddings generation

* Refactor embeddings generation

* Refactor embeddings generation

* Fix CHANGELOG.md

* Remove jpro-mdfx

* Add comment

* Fix localizations

* Fix checkstyle and remove OpenAI from PRIVACY.md

* Remove unnecessary comments

* Fix privacy notice UI

* Introduce new ApiKeyMissingComponent

* Thanks Tobiaz Diez for writing such a good EntryEditorTab class

* Fix InAnYan/jabref issues

* Merge `build.gradle` and `settings.gradle` from main branch

* Update ADRs

* Implement rethought ADR for chat history

* Use OpenAI embedding model

* Use Deep Java embedding model

* Remove old langchain4j embedding models

* Fix checkstyle errors

* Fix checkstyle and remove old dependencies

* Fixes from code review

* Restructure

* Fix checkstyle errors

* Add API base URL parameter

* Fix localization

* Fix from code review + ADR

* Something broken

* Now MistralAI and Hugging Face work

* Fix base URL for other LLM providers

* Fix base URL for other LLM providers

* Refactor MVStore usage

* Load embedding model in background

* Bump langchain4j version

* Fix bug

* Fix checkstyle and localization

* Implement summarization

* Fix checkstyle and localization

* Improve PrivacyNoticeComponent

* Fix from code review

* Update localization

* Wrap text

* Add padding

* Fix markdown

* Use stuff algorithm

* Add GPT-4o-mini

* Make chat model editable

* Update context window size and summarization

* Fix checkstyle

* Update PrivacyNoticeComponent.fxml

* Update AI summary tab

* Fix localization

* Change order so that there is no diff

* Reorrder dependencies

* Add missing CHANGELOG.md entry

* Refine ADR-0033

* Refine ADR0034

* Fix typos

* Refine ADR-0036

* Fix ADR-0037

* Fix title case

* Fix changes in module-info.java

* Readd removed requires org.apache.httpcomponents.core5.httpcore5

* Revert change in JabRefGUI to avoid conflicts

* Remove empty lines

* Reorder entries in JabRef_en.properties

* Simplify SummariesStorage (and add test)

* Use region/endregion

* Fix position of comment

* Add comment why the event bus is needed

* Do not show exception to the user - just that an error is occurred (saves %0 in localization)

* Use "URL %0" without colon (consistency)

* Fix typos

* History has to be kept

* Remove empty lines

* Fix language (hopefully)

* Compilefix

* Simplify BibDatabaseChatHistoryManager

* Fix from code review

* Fix issue #103

* Rework embeddings cache clearing

* Fix #99 and partially #101

* Partially fixing shutdown issues and UI progress monitor issue

* Add "requires scala.library" and add "region:" / "endregion"

* More grouping (move de.saxsys.mvvmfx.validation up)

* Add alphabetical hint

* Fix InAnYan#101 and InAnYan#106

* Discard changes to settings.gradle

* Fix InAnYan#105

* Follow-up fix for InAnYan#103

* Follow-up fix for InAnYan#103

* Remove obsolete class

* Partially fix InAnYan#98

* We do need dependencies to the AI providers, don't we?

* Fix InAnYan#93

* Simplify code

* Partially fix InAnYan#92

* Fix checkstyle and localization

* Fix hyperlinks and text in ApiKeyMissingComponent

* Fixes from code review

* Fix InAnYan#120

* Remove "X% work done" messages

* Fix InAnYan#114

* Partially fix InAnYan#113

* Partially fix InAnYan#110

* Fix InAnYan#110

* Fix InAnYan#111

* Improve embedding model downloading notifications

* Fix InAnYan#124

* Fix InAnYan#122

* Fix wrong context window size when expert settings customization is turned off

* Attempt to fix InAnYan#95

* Finally fix InAnYan#105

* Fix InAnYan#108

* Attempt to fix InAnYan#98

* Fix for InAnYan#104

* Fix for InAnYan#98

* Fix for InAnYan#95 (comment)

* Fix for InAnYan#98 (comment)

* Fix for InAnYan#126

* Fix for InAnYan#115

* Fix for InAnYan#113

* Fix for InAnYan#91

* Fix for InAnYan#121

* Fix for InAnYan#112 and InAnYan#116

* Fix for InAnYan#125

* Fixes from commit comments

* Fix for InAnYan#115

* Fix for InAnYan#120

* Fix for InAnYan#132

* Fix for InAnYan#132

* Fix for InAnYan#104

* Fix for InAnYan#118

* Fix for InAnYan#114

* Fix for InAnYan#104

* Store error messages in chat history

* Make error be a ChatMessageComponent

* Implement delete messages InAnYan#136

* Fix for InAnYan#118

* Fix for InAnYan#92

* Fix checkstyle and localization. And refactoring

* Fix for InAnYan#92

* Fix for InAnYan#139

* Show "Delete message" button only when necessary

* Fix for InAnYan#83

* Update src/main/java/org/jabref/logic/ai/AiService.java

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* Update src/main/java/org/jabref/logic/ai/chathistory/BibDatabaseChatHistoryManager.java

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* Update src/main/java/org/jabref/logic/ai/AiService.java

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* Update src/main/java/org/jabref/gui/Base.css

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* Update src/main/java/org/jabref/gui/Base.css

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>

* Fix from code review

* Partial fix for InAnYan#125

* Update colors for error message

* Fix for InAnYan#145 and InAnYan#142

* Make progress for embedding model download

* Fix checkstyle and localization

* Add workaround to get FileHistoryMenuTest running again

* Small fixes

* Revert "Small fixes"

This reverts commit 85382a1.

* Introduce AiApiKeyProvider

* Fix IDE setup instructions

* Do not load API keys on startup

* Rely on keystore encryption

* Prevent mulitple rebuilds when muliple preferences are updated

* Fix localization to be more provider independent

* Fix method names

* Add poor man's solution to notify of API key changes

* Reduce calls to key store (and fix key saving)

* Fix for InAnYan#148 and partially InAnYan#146

* Revert "Fix for InAnYan#148 and partially InAnYan#146"

This reverts commit 5fa3bb5.

* Fix for scrolling down when deleting a message

* Sort EmbeddingModel enum variants

* Fix GenerateSummaryTask progress indication

* Fix dark mode

* Add notice for embedding models size

---------

Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback The submitter needs to recheck the issue or provide more information about the issue
Projects
None yet
Development

No branches or pull requests

2 participants