From 66ff34c5773a367813ee5603b25b89d76ee49e95 Mon Sep 17 00:00:00 2001 From: InAnYan Date: Thu, 19 Sep 2024 20:05:59 +0300 Subject: [PATCH 1/3] Fix group chat history and group embeddings generation --- src/main/java/org/jabref/gui/JabRefGUI.java | 3 ++- src/main/java/org/jabref/logic/ai/AiService.java | 1 - .../logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/jabref/gui/JabRefGUI.java b/src/main/java/org/jabref/gui/JabRefGUI.java index 4ba82c1fed5..d6a80bf3947 100644 --- a/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/src/main/java/org/jabref/gui/JabRefGUI.java @@ -168,7 +168,6 @@ public void initialize() { JabRefGUI.aiService = new AiService( preferences.getAiPreferences(), preferences.getFilePreferences(), - preferences.getCitationKeyPatternPreferences(), dialogService, taskExecutor); Injector.setModelOrService(AiService.class, aiService); @@ -376,6 +375,8 @@ public void stop() { } catch (Exception e) { LOGGER.error("Unable to close AI service", e); } + LOGGER.trace("Closing chat history service"); + chatHistoryService.close(); LOGGER.trace("Closing OpenOffice connection"); OOBibBaseConnect.closeOfficeConnection(); LOGGER.trace("Stopping background tasks"); diff --git a/src/main/java/org/jabref/logic/ai/AiService.java b/src/main/java/org/jabref/logic/ai/AiService.java index cda0db2db69..9badeadf1ef 100644 --- a/src/main/java/org/jabref/logic/ai/AiService.java +++ b/src/main/java/org/jabref/logic/ai/AiService.java @@ -55,7 +55,6 @@ public class AiService implements AutoCloseable { public AiService(AiPreferences aiPreferences, FilePreferences filePreferences, - CitationKeyPatternPreferences citationKeyPatternPreferences, NotificationService notificationService, TaskExecutor taskExecutor ) { diff --git a/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java b/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java index 0bb1626a035..d04070e838b 100644 --- a/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java +++ b/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java @@ -8,6 +8,7 @@ import javafx.beans.property.StringProperty; import javafx.util.Pair; +import org.jabref.gui.util.UiTaskExecutor; import org.jabref.logic.FilePreferences; import org.jabref.logic.ai.processingstatus.ProcessingInfo; import org.jabref.logic.ai.processingstatus.ProcessingState; @@ -79,7 +80,8 @@ public Void call() throws Exception { linkedFiles .stream() .map(processingInfo -> { - processingInfo.setState(ProcessingState.PROCESSING); + UiTaskExecutor.runInJavaFXThread(() -> processingInfo.setState(ProcessingState.PROCESSING)); + return new Pair<>( new GenerateEmbeddingsTask( processingInfo.getObject(), From 56cb492c3fee3e2021a839654de2ba3ab707dd95 Mon Sep 17 00:00:00 2001 From: InAnYan Date: Fri, 20 Sep 2024 08:07:59 +0300 Subject: [PATCH 2/3] Fix group chat history and group embeddings generation --- .../logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java b/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java index d04070e838b..0bb1626a035 100644 --- a/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java +++ b/src/main/java/org/jabref/logic/ai/ingestion/GenerateEmbeddingsForSeveralTask.java @@ -8,7 +8,6 @@ import javafx.beans.property.StringProperty; import javafx.util.Pair; -import org.jabref.gui.util.UiTaskExecutor; import org.jabref.logic.FilePreferences; import org.jabref.logic.ai.processingstatus.ProcessingInfo; import org.jabref.logic.ai.processingstatus.ProcessingState; @@ -80,8 +79,7 @@ public Void call() throws Exception { linkedFiles .stream() .map(processingInfo -> { - UiTaskExecutor.runInJavaFXThread(() -> processingInfo.setState(ProcessingState.PROCESSING)); - + processingInfo.setState(ProcessingState.PROCESSING); return new Pair<>( new GenerateEmbeddingsTask( processingInfo.getObject(), From ec96388e3d350a378ac7dae3c3ac43cf302cbd41 Mon Sep 17 00:00:00 2001 From: InAnYan Date: Fri, 20 Sep 2024 10:13:00 +0300 Subject: [PATCH 3/3] Fix checkstyle --- src/main/java/org/jabref/logic/ai/AiService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/ai/AiService.java b/src/main/java/org/jabref/logic/ai/AiService.java index 9badeadf1ef..30655f1721c 100644 --- a/src/main/java/org/jabref/logic/ai/AiService.java +++ b/src/main/java/org/jabref/logic/ai/AiService.java @@ -15,7 +15,6 @@ import org.jabref.logic.ai.ingestion.storages.MVStoreFullyIngestedDocumentsTracker; import org.jabref.logic.ai.summarization.SummariesService; import org.jabref.logic.ai.summarization.storages.MVStoreSummariesStorage; -import org.jabref.logic.citationkeypattern.CitationKeyPatternPreferences; import org.jabref.logic.util.Directories; import org.jabref.logic.util.NotificationService; import org.jabref.logic.util.TaskExecutor;