From 95d65d2e316ba0b2da9ae4dabd9119fc5cefc02e Mon Sep 17 00:00:00 2001 From: Emmanuel Hugonnet Date: Fri, 13 Dec 2024 12:21:24 +0100 Subject: [PATCH] Cleaning dependencies in examples for simpler upgrade. (#71) Moving traces down a level to be less verbose. Upgrading lombok from 1.18.32 to 1.18.36 Upgrading langchain4j from 0.34.0 to 0.36.2 Upgrading sl4fj from 2.0.9 to 2.0.16 Upgrading jandex maven plugin from 3.1.2 to 3.1.8 Upgrading helidon from 4.0.7 to 4.0.12 Signed-off-by: Emmanuel Hugonnet --- .gitignore | 2 +- examples/glassfish-car-booking/pom.xml | 7 - .../helidon-car-booking-portable-ext/pom.xml | 13 +- examples/helidon-car-booking/pom.xml | 11 +- examples/liberty-car-booking/pom.xml | 335 ++++++++---------- examples/pom.xml | 67 ++++ examples/quarkus-car-booking/pom.xml | 12 +- pom.xml | 58 +-- .../mpconfig/LLMConfigMPConfig.java | 3 +- .../LangChain4JPluginsPortableExtension.java | 5 +- 10 files changed, 248 insertions(+), 265 deletions(-) diff --git a/.gitignore b/.gitignore index 7879fe1..ea7b1e9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,5 @@ buildNumber.properties .classpath .idea - +nb-configuration.xml diff --git a/examples/glassfish-car-booking/pom.xml b/examples/glassfish-car-booking/pom.xml index 1dc46e0..f5f4c26 100644 --- a/examples/glassfish-car-booking/pom.xml +++ b/examples/glassfish-car-booking/pom.xml @@ -28,7 +28,6 @@ io.smallrye.llm smallrye-llm-langchain4j-portable-extension - 1.0.0-SNAPSHOT jakarta.enterprise @@ -59,36 +58,30 @@ org.projectlombok lombok - 1.18.32 provided dev.langchain4j langchain4j - ${dev.langchain4j.version} dev.langchain4j langchain4j-hugging-face - ${dev.langchain4j.version} dev.langchain4j langchain4j-open-ai - ${dev.langchain4j.version} dev.langchain4j langchain4j-embeddings-all-minilm-l6-v2 - ${dev.langchain4j.version} org.slf4j slf4j-jdk14 runtime - 2.0.9 diff --git a/examples/helidon-car-booking-portable-ext/pom.xml b/examples/helidon-car-booking-portable-ext/pom.xml index b9a2307..d1c9c32 100644 --- a/examples/helidon-car-booking-portable-ext/pom.xml +++ b/examples/helidon-car-booking-portable-ext/pom.xml @@ -12,7 +12,6 @@ io.helidon.Main - 0.34.0 @@ -20,14 +19,14 @@ io.helidon helidon-bom - 4.0.7 + 4.0.12 pom import io.helidon helidon-dependencies - 4.0.7 + 4.0.12 pom import @@ -38,12 +37,10 @@ io.smallrye.llm smallrye-llm-langchain4j-portable-extension - 1.0.0-SNAPSHOT io.smallrye.llm smallrye-llm-langchain4j-config-mpconfig - 1.0.0-SNAPSHOT @@ -96,35 +93,29 @@ org.projectlombok lombok - 1.18.32 provided dev.langchain4j langchain4j - ${dev.langchain4j.version} dev.langchain4j langchain4j-hugging-face - ${dev.langchain4j.version} dev.langchain4j langchain4j-open-ai - ${dev.langchain4j.version} dev.langchain4j langchain4j-embeddings-all-minilm-l6-v2 - ${dev.langchain4j.version} com.azure azure-xml - 1.0.0-beta.3 runtime diff --git a/examples/helidon-car-booking/pom.xml b/examples/helidon-car-booking/pom.xml index 47ee4b0..3e1d666 100644 --- a/examples/helidon-car-booking/pom.xml +++ b/examples/helidon-car-booking/pom.xml @@ -20,14 +20,14 @@ io.helidon helidon-bom - 4.0.7 + 4.0.12 pom import io.helidon helidon-dependencies - 4.0.7 + 4.0.12 pom import @@ -38,12 +38,10 @@ io.smallrye.llm smallrye-llm-langchain4j-buildcompatible-extension - 1.0.0-SNAPSHOT io.smallrye.llm smallrye-llm-langchain4j-config-mpconfig - 1.0.0-SNAPSHOT @@ -100,7 +98,6 @@ org.projectlombok lombok - 1.18.32 provided @@ -111,23 +108,19 @@ dev.langchain4j langchain4j-hugging-face - ${dev.langchain4j.version} dev.langchain4j langchain4j-open-ai - ${dev.langchain4j.version} dev.langchain4j langchain4j-embeddings-all-minilm-l6-v2 - ${dev.langchain4j.version} com.azure azure-xml - 1.0.0-beta.3 runtime diff --git a/examples/liberty-car-booking/pom.xml b/examples/liberty-car-booking/pom.xml index cb0c9c4..69ef05c 100644 --- a/examples/liberty-car-booking/pom.xml +++ b/examples/liberty-car-booking/pom.xml @@ -1,176 +1,121 @@ - 4.0.0 - - io.smallrye.llm.examples - examples - 1.0.0-SNAPSHOT - + 4.0.0 + + io.smallrye.llm.examples + examples + 1.0.0-SNAPSHOT + - liberty-car-booking - war - SmallRye LLM Examples: Liberty Car Booking + liberty-car-booking + war + SmallRye LLM Examples: Liberty Car Booking - - - Buhake Sindi - +2 - - + + + Buhake Sindi + +2 + + - - UTF-8 - UTF-8 - 10.0.0 - 6.1 - 3.13.0 - 3.4.0 - 0.34.0 - - - ${project.build.directory}/liberty/wlp/usr/shared/resources/lib/ - + + UTF-8 + UTF-8 + 10.0.0 + 6.1 + 3.13.0 + 3.4.0 + + ${project.build.directory}/liberty/wlp/usr/shared/resources/lib/ + - - - - - jakarta.platform - jakarta.jakartaee-api - ${jakartaee-api.version} - provided - - - - org.eclipse.microprofile - microprofile - ${microprofile-api.version} - pom - provided - - - + + + + + jakarta.platform + jakarta.jakartaee-api + ${jakartaee-api.version} + provided + - - io.smallrye.llm - smallrye-llm-langchain4j-config-mpconfig - 1.0.0-SNAPSHOT - - - - io.smallrye.llm - smallrye-llm-langchain4j-portable-extension - 1.0.0-SNAPSHOT - - - - - dev.langchain4j - langchain4j - ${dev.langchain4j.version} - - - - dev.langchain4j - langchain4j-hugging-face - ${dev.langchain4j.version} - - - - - dev.langchain4j - langchain4j-azure-open-ai - ${dev.langchain4j.version} - + + org.eclipse.microprofile + microprofile + ${microprofile-api.version} + pom + provided + - - dev.langchain4j - langchain4j-open-ai - ${dev.langchain4j.version} - - - - dev.langchain4j - langchain4j-embeddings-all-minilm-l6-v2 - ${dev.langchain4j.version} - - - - - ai.djl.huggingface - tokenizers - 0.30.0 - - - - - org.slf4j - slf4j-jdk14 - runtime - 2.0.9 - - - + + + + + ai.djl.huggingface + tokenizers + 0.30.0 + + + - - - + + + - - org.eclipse.microprofile - microprofile - pom - + + org.eclipse.microprofile + microprofile + pom + io.smallrye.llm smallrye-llm-langchain4j-config-mpconfig - - io.smallrye.llm - smallrye-llm-langchain4j-portable-extension - + + io.smallrye.llm + smallrye-llm-langchain4j-portable-extension + - + - + org.projectlombok lombok - 1.18.32 provided @@ -186,10 +131,10 @@ - - dev.langchain4j - langchain4j-azure-open-ai - + + dev.langchain4j + langchain4j-azure-open-ai + dev.langchain4j @@ -202,10 +147,10 @@ - - ai.djl.huggingface - tokenizers - + + ai.djl.huggingface + tokenizers + @@ -213,43 +158,43 @@ slf4j-jdk14 runtime - + - - ${project.artifactId} - - - - - io.openliberty.tools - liberty-maven-plugin - 3.10.3 - - - ${project.build.finalName} - ${project.basedir}/docs-for-rag - - - - - + + ${project.artifactId} + + + + + io.openliberty.tools + liberty-maven-plugin + 3.10.3 + + + ${project.build.finalName} + ${project.basedir}/docs-for-rag + + + + + - - - org.apache.maven.plugins - maven-compiler-plugin - + + + org.apache.maven.plugins + maven-compiler-plugin + - - io.openliberty.tools - liberty-maven-plugin - + + io.openliberty.tools + liberty-maven-plugin + - - org.apache.maven.plugins - maven-war-plugin - ${war-plugin.version} - - - + + org.apache.maven.plugins + maven-war-plugin + ${war-plugin.version} + + + \ No newline at end of file diff --git a/examples/pom.xml b/examples/pom.xml index 1bea750..7aeee5b 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -19,4 +19,71 @@ glassfish-car-booking liberty-car-booking + + + 0.36.2 + + + + + + io.smallrye.llm + smallrye-llm-langchain4j-buildcompatible-extension + ${project.version} + + + io.smallrye.llm + smallrye-llm-langchain4j-config-mpconfig + ${project.version} + + + io.smallrye.llm + smallrye-llm-langchain4j-portable-extension + ${project.version} + + + org.projectlombok + lombok + 1.18.36 + provided + + + dev.langchain4j + langchain4j + ${dev.langchain4j.version} + + + dev.langchain4j + langchain4j-azure-open-ai + ${dev.langchain4j.version} + + + dev.langchain4j + langchain4j-embeddings-all-minilm-l6-v2 + ${dev.langchain4j.version} + + + dev.langchain4j + langchain4j-hugging-face + ${dev.langchain4j.version} + + + dev.langchain4j + langchain4j-open-ai + ${dev.langchain4j.version} + + + com.azure + azure-xml + 1.0.0-beta.3 + runtime + + + org.slf4j + slf4j-jdk14 + 2.0.16 + runtime + + + diff --git a/examples/quarkus-car-booking/pom.xml b/examples/quarkus-car-booking/pom.xml index 54a9889..82d578e 100644 --- a/examples/quarkus-car-booking/pom.xml +++ b/examples/quarkus-car-booking/pom.xml @@ -16,7 +16,7 @@ UTF-8 quarkus-bom io.quarkus.platform - 3.8.5 + 3.8.6 true 3.2.5 @@ -37,44 +37,36 @@ io.smallrye.llm smallrye-llm-langchain4j-buildcompatible-extension - 1.0.0-SNAPSHOT io.smallrye.llm smallrye-llm-langchain4j-config-mpconfig - 1.0.0-SNAPSHOT org.projectlombok lombok - 1.18.32 dev.langchain4j langchain4j - ${dev.langchain4j.version} dev.langchain4j langchain4j-hugging-face - ${dev.langchain4j.version} dev.langchain4j langchain4j-azure-open-ai - ${dev.langchain4j.version} dev.langchain4j langchain4j-embeddings-all-minilm-l6-v2 - ${dev.langchain4j.version} com.azure azure-xml - 1.0.0-beta.3 runtime @@ -113,7 +105,7 @@ io.smallrye jandex-maven-plugin - 3.1.2 + 3.1.8 make-index diff --git a/pom.xml b/pom.xml index 881e44b..33d1300 100644 --- a/pom.xml +++ b/pom.xml @@ -1,20 +1,20 @@ +~ Copyright 2017 Red Hat, Inc. +~ +~ Licensed under the Apache License, Version 2.0 (the "License"); +~ you may not use this file except in compliance with the License. +~ You may obtain a copy of the License at +~ +~ http://www.apache.org/licenses/LICENSE-2.0 +~ +~ Unless required by applicable law or agreed to in writing, software +~ distributed under the License is distributed on an "AS IS" BASIS, +~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~ See the License for the specific language governing permissions and +~ limitations under the License. +--> 4.0.0 @@ -35,14 +35,14 @@ 3.1 - 2.4.0 + 2.9.0 9.7 - 2.3.0 + 2.3.1 4.1.0 - 4.0.0.Final + 4.0.3.Final 5.1.3.Final 3.5.3.Final - 0.34.0 + 0.36.1 17 17 @@ -141,19 +141,19 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - + + + + org.apache.maven.plugins + maven-compiler-plugin + - - org.apache.maven.plugins - maven-surefire-plugin - + + org.apache.maven.plugins + maven-surefire-plugin + - + diff --git a/smallrye-llm-langchain4j-config-mpconfig/src/main/java/io/smallrye/llm/core/langchain4j/mpconfig/LLMConfigMPConfig.java b/smallrye-llm-langchain4j-config-mpconfig/src/main/java/io/smallrye/llm/core/langchain4j/mpconfig/LLMConfigMPConfig.java index 7c69571..089840f 100644 --- a/smallrye-llm-langchain4j-config-mpconfig/src/main/java/io/smallrye/llm/core/langchain4j/mpconfig/LLMConfigMPConfig.java +++ b/smallrye-llm-langchain4j-config-mpconfig/src/main/java/io/smallrye/llm/core/langchain4j/mpconfig/LLMConfigMPConfig.java @@ -2,6 +2,7 @@ import static io.smallrye.llm.core.langchain4j.core.config.spi.LLMConfig.getBeanPropertyName; +import java.util.Collections; import java.util.Set; import java.util.Spliterator; import java.util.Spliterators; @@ -36,7 +37,7 @@ private static Stream getPropertyNameStream(Config config) { @Override public Set getBeanNames() { - return beanNames; + return Collections.unmodifiableSet(beanNames); } @Override diff --git a/smallrye-llm-langchain4j-portable-extension/src/main/java/io/smallrye/llm/core/langchain4j/portableextension/LangChain4JPluginsPortableExtension.java b/smallrye-llm-langchain4j-portable-extension/src/main/java/io/smallrye/llm/core/langchain4j/portableextension/LangChain4JPluginsPortableExtension.java index 6b37305..3254fd5 100644 --- a/smallrye-llm-langchain4j-portable-extension/src/main/java/io/smallrye/llm/core/langchain4j/portableextension/LangChain4JPluginsPortableExtension.java +++ b/smallrye-llm-langchain4j-portable-extension/src/main/java/io/smallrye/llm/core/langchain4j/portableextension/LangChain4JPluginsPortableExtension.java @@ -21,13 +21,14 @@ public class LangChain4JPluginsPortableExtension implements Extension { void afterBeanDiscovery(@Observes AfterBeanDiscovery afterBeanDiscovery, BeanManager beanManager) throws ClassNotFoundException { - if (llmConfig == null) + if (llmConfig == null) { llmConfig = LLMConfigProvider.getLlmConfig(); + } CommonLLMPluginCreator.createAllLLMBeans( llmConfig, beanData -> { - LOGGER.info("Add Bean " + beanData.getTargetClass() + " " + beanData.getScopeClass() + " " + LOGGER.debug("Add Bean " + beanData.getTargetClass() + " " + beanData.getScopeClass() + " " + beanData.getBeanName()); afterBeanDiscovery.addBean()