From c2b8a296fee09dbdb7415675e28fd3c11f8a3fc2 Mon Sep 17 00:00:00 2001 From: InAnYan Date: Thu, 3 Oct 2024 17:07:27 +0300 Subject: [PATCH 1/7] Start to work --- build.gradle | 2 +- src/main/java/module-info.java | 1 + .../org/jabref/gui/preferences/ai/AiTab.fxml | 30 ++++- .../org/jabref/gui/preferences/ai/AiTab.java | 22 +++- .../gui/preferences/ai/AiTabViewModel.java | 63 +++++++--- .../jabref/logic/ai/AiDefaultPreferences.java | 42 ++++++- .../org/jabref/logic/ai/AiPreferences.java | 18 ++- .../java/org/jabref/logic/ai/AiService.java | 10 +- .../jabref/logic/ai/chatting/AiChatLogic.java | 119 ++++++++++++------ .../logic/ai/chatting/AiChatService.java | 9 +- .../ai/summarization/GenerateSummaryTask.java | 47 ++----- .../ai/summarization/SummariesService.java | 5 + .../jabref/logic/ai/templates/AiTemplate.java | 28 +++++ .../logic/ai/templates/PaperExcerpt.java | 3 + .../logic/ai/templates/TemplatesService.java | 62 +++++++++ .../java/org/jabref/logic/help/HelpFile.java | 3 +- .../preferences/JabRefCliPreferences.java | 22 +++- 17 files changed, 369 insertions(+), 117 deletions(-) create mode 100644 src/main/java/org/jabref/logic/ai/templates/AiTemplate.java create mode 100644 src/main/java/org/jabref/logic/ai/templates/PaperExcerpt.java create mode 100644 src/main/java/org/jabref/logic/ai/templates/TemplatesService.java diff --git a/build.gradle b/build.gradle index ff57188b2c0..235b10012b6 100644 --- a/build.gradle +++ b/build.gradle @@ -351,7 +351,7 @@ dependencies { exclude group: 'org.jetbrains.kotlin' } - + implementation 'org.apache.velocity:velocity-engine-core:2.3' implementation platform('ai.djl:bom:0.30.0') implementation 'ai.djl:api' implementation 'ai.djl.huggingface:tokenizers' diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index cd22dd41ad4..fcb7072b981 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -189,5 +189,6 @@ requires org.antlr.antlr4.runtime; requires org.libreoffice.uno; requires langchain4j.google.ai.gemini; + requires velocity.engine.core; // endregion } diff --git a/src/main/java/org/jabref/gui/preferences/ai/AiTab.fxml b/src/main/java/org/jabref/gui/preferences/ai/AiTab.fxml index c5dfc69e9de..aa1eb09927b 100644 --- a/src/main/java/org/jabref/gui/preferences/ai/AiTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/ai/AiTab.fxml @@ -147,10 +147,6 @@ - - @@ -220,5 +216,31 @@ glyph="REFRESH"/> + + + - - - + + +