You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2025/09/02 12:56:08 UTC
(camel-quarkus) branch main updated: Remove Quarkus LangChain4j from camel-quarkus-langchain4j-* extensions
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new ab2472c5d1 Remove Quarkus LangChain4j from camel-quarkus-langchain4j-* extensions
ab2472c5d1 is described below
commit ab2472c5d1cc36b581e0a7ede7a6e7ae9fa053e3
Author: James Netherton <ja...@users.noreply.github.com>
AuthorDate: Tue Sep 2 13:56:04 2025 +0100
Remove Quarkus LangChain4j from camel-quarkus-langchain4j-* extensions
Fixes #7587
---
catalog/pom.xml | 13 --
docs/modules/ROOT/nav.adoc | 1 -
.../modules/ROOT/pages/migration-guide/3.27.0.adoc | 13 ++
docs/modules/ROOT/pages/migration-guide/index.adoc | 1 +
.../reference/extensions/langchain4j-agent.adoc | 12 +-
.../reference/extensions/langchain4j-chat.adoc | 12 +-
.../extensions/langchain4j-embeddings.adoc | 12 +-
.../extensions/langchain4j-tokenizer.adoc | 12 +-
.../reference/extensions/langchain4j-tools.adoc | 12 +-
.../extensions/langchain4j-web-search.adoc | 12 +-
.../pages/reference/extensions/langchain4j.adoc | 144 -------------------
.../langchain4j-agent/deployment/pom.xml | 4 +
extensions-jvm/langchain4j-agent/runtime/pom.xml | 4 +
extensions-support/langchain4j/deployment/pom.xml | 4 +-
.../deployment/SupportLangchain4jProcessor.java | 68 ++++-----
extensions-support/langchain4j/runtime/pom.xml | 8 +-
.../support/langchain4j/Langchain4jRecorder.java | 37 -----
extensions/langchain4j-chat/deployment/pom.xml | 4 -
.../chat/deployment/LangChain4jChatProcessor.java | 35 ++++-
extensions/langchain4j-chat/runtime/pom.xml | 4 -
.../langchain4j-tokenizer/deployment/pom.xml | 4 +-
.../deployment/Langchain4jTokenizerProcessor.java | 33 +++++
extensions/langchain4j-tokenizer/runtime/pom.xml | 8 +-
.../langchain4j-web-search/deployment/pom.xml | 9 ++
.../deployment/Langchain4jWebSearchProcessor.java | 68 ++++++++-
extensions/langchain4j-web-search/runtime/pom.xml | 8 ++
extensions/langchain4j/deployment/pom.xml | 65 ---------
.../chat/deployment/LangChain4jProcessor.java | 51 -------
extensions/langchain4j/pom.xml | 37 -----
extensions/langchain4j/runtime/pom.xml | 73 ----------
.../runtime/src/main/doc/configuration.adoc | 75 ----------
.../main/resources/META-INF/quarkus-extension.yaml | 34 -----
extensions/pom.xml | 1 -
integration-tests/langchain4j-chat/pom.xml | 25 +++-
.../langchain/chat/it/LangChain4jChatResource.java | 25 ++++
.../component/langchain/chat/it/OllamaRoute.java | 6 +-
.../src/main/resources/application.properties | 35 -----
..._chat-209afadc-b5a5-4421-a5ed-12df7022ee83.json | 27 ++++
...chat-26bc7007-3e10-45a9-90f1-aa22c18fe23a.json} | 12 +-
..._chat-6295474b-b951-49fb-be50-dbe0aa93fa0c.json | 27 ++++
..._chat-a2a5aabd-ef52-4fc3-84a3-6e6f1bd7ce93.json | 24 ++++
..._chat-cff406ca-7bff-4de8-ac45-693be8a005e0.json | 26 ++++
.../src/test/resources/mappings/promptMessage.json | 24 ----
.../src/test/resources/mappings/simpleMessage.json | 24 ----
integration-tests/langchain4j-tokenizer/pom.xml | 4 +-
integration-tests/langchain4j-tools/pom.xml | 4 +-
.../tools/it/Langchain4jToolsProducers.java} | 36 ++---
.../tools/it/Langchain4jToolsRoutes.java | 6 +-
.../src/main/resources/application.properties | 11 --
.../langchain4j/tools/it/Langchain4jToolsTest.java | 2 +-
.../langchain4j/tools/it/OllamaTestResource.java | 4 +-
..._chat-3a96d932-0bd9-45c0-8482-0fdc0cc67243.json | 26 ++++
..._chat-58a8c909-b8c3-4e57-946a-110a8c6a6fab.json | 27 ++++
..._chat-717dbfe1-7c7e-4efc-b890-8e0d331dbad0.json | 25 ----
..._chat-f1009e50-53fa-4a9e-98d7-deaca89c803a.json | 25 ----
integration-tests/langchain4j-web-search/pom.xml | 4 +-
.../search/it/Langchain4jWebSearchProducers.java} | 37 ++---
.../web/search/it/TavilyTestResource.java | 4 +-
...earch-16c44e05-4596-4aa8-a50a-319ace00e152.json | 29 ----
...earch-a2a98ada-9170-4867-9d14-d3811f2c80d4.json | 26 ++++
integration-tests/langchain4j/pom.xml | 157 ---------------------
.../langchain/it/AiServiceResolvedByInterface.java | 51 -------
.../langchain/it/AiServiceResolvedByName.java | 53 -------
.../langchain/it/LangChain4jResource.java | 56 --------
.../component/langchain/it/MirrorAiService.java | 55 --------
.../component/langchain4jit/LangChain4jIT.java | 24 ----
.../component/langchain4jit/LangChain4jTest.java | 56 --------
integration-tests/pom.xml | 1 -
poms/bom-test/pom.xml | 18 +--
poms/bom/pom.xml | 20 ---
poms/bom/src/main/generated/flattened-full-pom.xml | 20 ---
.../src/main/generated/flattened-reduced-pom.xml | 20 ---
.../generated/flattened-reduced-verbose-pom.xml | 20 ---
tooling/internal-dependency-management/pom.xml | 7 +
.../quarkus/maven/UpdateExtensionDocPageMojo.java | 1 +
.../doc-templates/extension-doc-page.adoc | 12 +-
tooling/scripts/test-categories.yaml | 1 -
77 files changed, 564 insertions(+), 1411 deletions(-)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index bc45a18a8c..93d7d907df 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -2411,19 +2411,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-agent</artifactId>
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 2516d6c9cb..bd73535f5e 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -346,7 +346,6 @@
*** xref:reference/extensions/grpc.adoc[gRPC]
*** xref:reference/extensions/ical.adoc[iCal]
*** xref:reference/extensions/joor.adoc[jOOR]
-*** xref:reference/extensions/langchain4j.adoc[langChain4j]
*** xref:reference/extensions/langchain4j-chat.adoc[langChain4j Chat]
*** xref:reference/extensions/univocity-parsers.adoc[uniVocity CSV]
*** xref:reference/extensions/weaviate.adoc[weaviate]// extensions: END
diff --git a/docs/modules/ROOT/pages/migration-guide/3.27.0.adoc b/docs/modules/ROOT/pages/migration-guide/3.27.0.adoc
new file mode 100644
index 0000000000..cac10fc98b
--- /dev/null
+++ b/docs/modules/ROOT/pages/migration-guide/3.27.0.adoc
@@ -0,0 +1,13 @@
+= Camel Quarkus 3.27.0 Migration Guide
+
+The following guide outlines how to adapt your code to changes that were made in Camel Quarkus 3.27.0.
+
+== Deprecated extension `camel-quarkus-langchain4j` removed
+
+Extension `camel-quarkus-langchain4j` was deprecated in Camel Quarkus 3.26.0. It has been removed in 3.27.0.
+
+== Quarkus LangChain4j removed from Camel Quarkus LangChain4j extensions
+
+To better align with the core functionality provided by the Camel LangChain4j components, Quarkus LangChain4j functionality has been removed from all Camel Quarkus LangChain4j extensions.
+
+The components provided by these extensions are now configured as per the instructions in their respective Camel component documentation.
diff --git a/docs/modules/ROOT/pages/migration-guide/index.adoc b/docs/modules/ROOT/pages/migration-guide/index.adoc
index d983a534a1..b85d9ffa41 100644
--- a/docs/modules/ROOT/pages/migration-guide/index.adoc
+++ b/docs/modules/ROOT/pages/migration-guide/index.adoc
@@ -4,6 +4,7 @@ We do frequent releases, a release almost every month, and even though we strive
Listed here are guides on how to migrate between major versions and anything of significance to watch for when upgrading from minor versions.
+* xref:migration-guide/3.27.0.adoc[Camel Quarkus 3.26.x to Camel Quarkus 3.27.0 migration guide]
* xref:migration-guide/3.26.0.adoc[Camel Quarkus 3.25.x to Camel Quarkus 3.26.0 migration guide]
* xref:migration-guide/3.23.0.adoc[Camel Quarkus 3.22.x to Camel Quarkus 3.23.0 migration guide]
* xref:migration-guide/3.18.0.adoc[Camel Quarkus 3.17.x to Camel Quarkus 3.18.0 migration guide]
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-agent.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-agent.adoc
index cf3c695a65..84d4bf4b0d 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-agent.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-agent.adoc
@@ -41,17 +41,17 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
endif::[]
[id="extensions-langchain4j-agent-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -61,4 +61,4 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc
index 5839bac617..5f6a371116 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-chat.adoc
@@ -45,17 +45,17 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
endif::[]
[id="extensions-langchain4j-chat-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -65,4 +65,4 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc
index d5de73d3c5..2f0c82e0dc 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-embeddings.adoc
@@ -41,17 +41,17 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
endif::[]
[id="extensions-langchain4j-embeddings-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -61,4 +61,4 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-tokenizer.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-tokenizer.adoc
index 5a9525afe4..b3a43a599d 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-tokenizer.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-tokenizer.adoc
@@ -45,17 +45,17 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
endif::[]
[id="extensions-langchain4j-tokenizer-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -65,4 +65,4 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-tools.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-tools.adoc
index c2cae6aedb..de775126f8 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-tools.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-tools.adoc
@@ -45,17 +45,17 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
endif::[]
[id="extensions-langchain4j-tools-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -65,4 +65,4 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j-web-search.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j-web-search.adoc
index 844a5bfce6..2bc9c14079 100644
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j-web-search.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/langchain4j-web-search.adoc
@@ -45,17 +45,17 @@ Check the xref:user-guide/index.adoc[User guide] for more information about writ
endif::[]
[id="extensions-langchain4j-web-search-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>1.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -65,4 +65,4 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
diff --git a/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc b/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc
deleted file mode 100644
index cd64aebc4e..0000000000
--- a/docs/modules/ROOT/pages/reference/extensions/langchain4j.adoc
+++ /dev/null
@@ -1,144 +0,0 @@
-// Do not edit directly!
-// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
-[id="extensions-langchain4j"]
-= langChain4j
-:linkattrs:
-:cq-artifact-id: camel-quarkus-langchain4j
-:cq-native-supported: true
-:cq-status: Experimental
-:cq-status-deprecation: Experimental Deprecated
-:cq-description: LangChain4j high level api usage with Camel Quarkus
-:cq-deprecated: true
-:cq-jvm-since: 3.16.0
-:cq-native-since: 3.16.0
-
-ifeval::[{doc-show-badges} == true]
-[.badges]
-[.badge-key]##JVM since##[.badge-supported]##3.16.0## [.badge-key]##Native since##[.badge-supported]##3.16.0## [.badge-key]##⚠️##[.badge-unsupported]##Deprecated##
-endif::[]
-
-LangChain4j high level api usage with Camel Quarkus
-
-[id="extensions-langchain4j-maven-coordinates"]
-== Maven coordinates
-
-https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-langchain4j[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]
-
-Or add the coordinates to your existing project:
-
-[source,xml]
-----
-<dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j</artifactId>
-</dependency>
-----
-ifeval::[{doc-show-user-guide-link} == true]
-Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
-endif::[]
-
-[id="extensions-langchain4j-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
-
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
-[source,xml]
-----
-<dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- ...
-</dependencyManagement>
-----
-
-Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
-
-[id="extensions-langchain4j-additional-camel-quarkus-configuration"]
-== Additional Camel Quarkus configuration
-
-[id="extensions-langchain4j-configuration-using-camel-annotations-from-langchain4j-ai-service-method-parameters"]
-=== Using camel annotations from LangChain4j AI service method parameters
-
-The `camel-quarkus-langchain4j` extension makes it possible to use camel parameter binding annotations with LangChain4j AI services.
-
-For example:
-
-[source,java]
-----
-@RegisterAiService
-@ApplicationScoped
-public interface CustomAiService {
- @UserMessage("An LLM prompt that can use the method parameter {myHeaderInjectedIntoPrompt}.")
- @Handler
- String invokeLlm(@Header("myHeaderName") String myHeaderInjectedIntoPrompt);
-}
-----
-
-You can find more details about Camel Parameter Binding annotations in the xref:manual::parameter-binding-annotations.adoc[manual].
-
-[id="extensions-langchain4j-configuration-resolving-ai-services-by-interface"]
-=== Resolving AI services by interface
-
-With the `camel-quarkus-langchain4j` extension, the AI services are resolvable by interface when called from a `bean` statement.
-
-For instance, let's define an AI service below:
-
-[source,java]
-----
-@ApplicationScoped
-@RegisterAiService
-public interface MyAiService {
- @UserMessage("My Prompt")
- @Handler
- String chat(String question);
-}
-----
-
-The AI service could then be invoked from a Camel route like this:
-
-[source,java]
-----
-@Override
-public void configure() {
- from("...")
- .bean(MyAiService.class);
-}
-----
-
-[id="extensions-langchain4j-configuration-resolving-ai-services-by-bean-name"]
-=== Resolving AI services by bean name
-
-The AI services are also resolvable by bean name when called from a `bean` statement.
-
-For instance, let's define an AI service below:
-
-[source,java]
-----
-@ApplicationScoped
-@Named("aiServiceResolvedByName")
-@RegisterAiService
-public interface AiServiceResolvedByName {
- @UserMessage("My prompt")
- @Handler
- String chatByName(String input);
-}
-----
-
-The AI service could then be invoked from a Camel route as below:
-
-[source,java]
-----
-@Override
-public void configure() {
- from("...")
- .bean("aiServiceResolvedByName");
-}
-----
-
diff --git a/extensions-jvm/langchain4j-agent/deployment/pom.xml b/extensions-jvm/langchain4j-agent/deployment/pom.xml
index ede93cb48b..ff353c5feb 100644
--- a/extensions-jvm/langchain4j-agent/deployment/pom.xml
+++ b/extensions-jvm/langchain4j-agent/deployment/pom.xml
@@ -34,6 +34,10 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-langchain4j-deployment</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-agent</artifactId>
diff --git a/extensions-jvm/langchain4j-agent/runtime/pom.xml b/extensions-jvm/langchain4j-agent/runtime/pom.xml
index 745371cb8c..df30f7c261 100644
--- a/extensions-jvm/langchain4j-agent/runtime/pom.xml
+++ b/extensions-jvm/langchain4j-agent/runtime/pom.xml
@@ -40,6 +40,10 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-langchain4j</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-agent</artifactId>
diff --git a/extensions-support/langchain4j/deployment/pom.xml b/extensions-support/langchain4j/deployment/pom.xml
index 14365952b2..7f3b4fd22b 100644
--- a/extensions-support/langchain4j/deployment/pom.xml
+++ b/extensions-support/langchain4j/deployment/pom.xml
@@ -35,8 +35,8 @@
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core-deployment</artifactId>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
diff --git a/extensions-support/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/deployment/SupportLangchain4jProcessor.java b/extensions-support/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/deployment/SupportLangchain4jProcessor.java
index 22ca1fd5cc..ac34d5398d 100644
--- a/extensions-support/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/deployment/SupportLangchain4jProcessor.java
+++ b/extensions-support/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/deployment/SupportLangchain4jProcessor.java
@@ -16,51 +16,51 @@
*/
package org.apache.camel.quarkus.component.support.langchain4j.deployment;
-import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
-import dev.langchain4j.model.chat.ChatModel;
-import io.quarkiverse.langchain4j.deployment.items.SelectedChatModelProviderBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.annotations.ExecutionTime;
-import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
-import org.apache.camel.quarkus.component.support.langchain4j.Langchain4jRecorder;
-import org.apache.camel.quarkus.core.deployment.spi.CamelBeanQualifierResolverBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
class SupportLangchain4jProcessor {
- @Record(ExecutionTime.STATIC_INIT)
+
@BuildStep
- void chatModelBeanQualifiers(
- List<SelectedChatModelProviderBuildItem> chatModels,
- BuildProducer<CamelBeanQualifierResolverBuildItem> beanQualifierResolver,
- Langchain4jRecorder recorder) {
+ void indexDependencies(BuildProducer<IndexDependencyBuildItem> indexedDependencies) {
+ indexedDependencies.produce(new IndexDependencyBuildItem("dev.langchain4j", "langchain4j-http-client-jdk"));
+ indexedDependencies.produce(new IndexDependencyBuildItem("dev.langchain4j", "langchain4j-ollama"));
+ }
- // Enable ChatLanguageModel instances to be resolved by name from the Camel registry
- for (SelectedChatModelProviderBuildItem chatModel : chatModels) {
- beanQualifierResolver.produce(
- new CamelBeanQualifierResolverBuildItem(ChatModel.class,
- chatModel.getConfigName(),
- recorder.chatModelBeanQualifierResolver(chatModel.getConfigName())));
- }
+ @BuildStep
+ ServiceProviderBuildItem registerServiceProviders() {
+ return ServiceProviderBuildItem.allProvidersFromClassPath("dev.langchain4j.http.client.HttpClientBuilderFactory");
}
- // TODO: Remove this: https://github.com/apache/camel-quarkus/issues/7440
@BuildStep
- ReflectiveClassBuildItem registerForReflection() {
- return ReflectiveClassBuildItem.builder(
- "dev.langchain4j.model.ollama.FormatSerializer",
- "dev.langchain4j.model.ollama.Function",
- "dev.langchain4j.model.ollama.FunctionCall",
- "dev.langchain4j.model.ollama.Message",
- "dev.langchain4j.model.ollama.OllamaChatRequest",
- "dev.langchain4j.model.ollama.OllamaChatResponse",
- "dev.langchain4j.model.ollama.Options",
- "dev.langchain4j.model.ollama.Parameters",
- "dev.langchain4j.model.ollama.Role",
- "dev.langchain4j.model.ollama.Tool",
- "dev.langchain4j.model.ollama.ToolCall")
+ void registerForReflection(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
+ Set<String> ollamaModelClasses = combinedIndex.getIndex()
+ .getClassesInPackage("dev.langchain4j.model.ollama")
+ .stream()
+ .filter(classInfo -> classInfo.annotations().stream()
+ .anyMatch(annotationInstance -> annotationInstance.name().toString()
+ .startsWith("com.fasterxml.jackson.annotation")))
+ .map(ClassInfo::name)
+ .map(DotName::toString)
+ .collect(Collectors.toSet());
+
+ reflectiveClass.produce(ReflectiveClassBuildItem.builder(ollamaModelClasses.toArray(new String[0]))
.methods(true)
- .build();
+ .build());
+ }
+
+ @BuildStep
+ RuntimeInitializedClassBuildItem runtimeInitializedClasses() {
+ return new RuntimeInitializedClassBuildItem("dev.langchain4j.internal.RetryUtils");
}
}
diff --git a/extensions-support/langchain4j/runtime/pom.xml b/extensions-support/langchain4j/runtime/pom.xml
index e1dfd7391f..033c35c041 100644
--- a/extensions-support/langchain4j/runtime/pom.xml
+++ b/extensions-support/langchain4j/runtime/pom.xml
@@ -30,14 +30,14 @@
<name>Camel Quarkus :: Support :: Langchain4j :: Runtime</name>
<dependencies>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/extensions-support/langchain4j/runtime/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/Langchain4jRecorder.java b/extensions-support/langchain4j/runtime/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/Langchain4jRecorder.java
deleted file mode 100644
index 4526bbc041..0000000000
--- a/extensions-support/langchain4j/runtime/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/Langchain4jRecorder.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.support.langchain4j;
-
-import java.lang.annotation.Annotation;
-
-import io.quarkiverse.langchain4j.ModelName;
-import io.quarkus.runtime.RuntimeValue;
-import io.quarkus.runtime.annotations.Recorder;
-import org.apache.camel.quarkus.core.CamelBeanQualifierResolver;
-
-@Recorder
-public class Langchain4jRecorder {
- public RuntimeValue<CamelBeanQualifierResolver> chatModelBeanQualifierResolver(String modelName) {
- final ModelName.Literal modelNameLiteral = ModelName.Literal.of(modelName);
- return new RuntimeValue<>(new CamelBeanQualifierResolver() {
- @Override
- public Annotation[] resolveQualifiers() {
- return new Annotation[] { modelNameLiteral };
- }
- });
- }
-}
diff --git a/extensions/langchain4j-chat/deployment/pom.xml b/extensions/langchain4j-chat/deployment/pom.xml
index fe596f5f2d..2bb274ed88 100644
--- a/extensions/langchain4j-chat/deployment/pom.xml
+++ b/extensions/langchain4j-chat/deployment/pom.xml
@@ -30,10 +30,6 @@
<name>Camel Quarkus :: langChain4j Chat :: Deployment</name>
<dependencies>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core-deployment</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
diff --git a/extensions/langchain4j-chat/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jChatProcessor.java b/extensions/langchain4j-chat/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jChatProcessor.java
index 26f16ac8fb..43b259daa2 100644
--- a/extensions/langchain4j-chat/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jChatProcessor.java
+++ b/extensions/langchain4j-chat/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jChatProcessor.java
@@ -16,10 +16,11 @@
*/
package org.apache.camel.quarkus.component.langchain.chat.deployment;
-import io.quarkiverse.langchain4j.deployment.RequestChatModelBeanBuildItem;
-import io.quarkiverse.langchain4j.runtime.NamedConfigUtil;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
class LangChain4jChatProcessor {
private static final String FEATURE = "camel-langchain4j-chat";
@@ -30,8 +31,32 @@ class LangChain4jChatProcessor {
}
@BuildStep
- RequestChatModelBeanBuildItem defaultChatModelBean() {
- // Avoid the need for an injection point so that the chat model can be autowired easily
- return new RequestChatModelBeanBuildItem(NamedConfigUtil.DEFAULT_NAME);
+ NativeImageProxyDefinitionBuildItem nativeImageProxyConfig() {
+ return new NativeImageProxyDefinitionBuildItem("dev.langchain4j.model.ollama.OllamaApi");
+ }
+
+ @BuildStep
+ ReflectiveClassBuildItem reflectiveClass() {
+ return ReflectiveClassBuildItem.builder(PropertyNamingStrategies.SnakeCaseStrategy.class).constructors().build();
+ }
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflection() {
+ return ReflectiveClassBuildItem.builder(
+ "dev.langchain4j.model.ollama.FormatSerializer",
+ "dev.langchain4j.model.ollama.Function",
+ "dev.langchain4j.model.ollama.FunctionCall",
+ "dev.langchain4j.model.ollama.Message",
+ "dev.langchain4j.model.ollama.OllamaChatRequest",
+ "dev.langchain4j.model.ollama.OllamaChatResponse",
+ "dev.langchain4j.model.ollama.Options",
+ "dev.langchain4j.model.ollama.Parameters",
+ "dev.langchain4j.model.ollama.Role",
+ "dev.langchain4j.model.ollama.Tool",
+ "dev.langchain4j.model.ollama.ToolCall",
+ "dev.langchain4j.model.ollama.ChatRequest",
+ "dev.langchain4j.model.ollama.ChatResponse")
+ .methods(true)
+ .build();
}
}
diff --git a/extensions/langchain4j-chat/runtime/pom.xml b/extensions/langchain4j-chat/runtime/pom.xml
index 5386140748..ade173c51b 100644
--- a/extensions/langchain4j-chat/runtime/pom.xml
+++ b/extensions/langchain4j-chat/runtime/pom.xml
@@ -37,10 +37,6 @@
</properties>
<dependencies>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
diff --git a/extensions/langchain4j-tokenizer/deployment/pom.xml b/extensions/langchain4j-tokenizer/deployment/pom.xml
index bde64b4eb0..b67108ede4 100644
--- a/extensions/langchain4j-tokenizer/deployment/pom.xml
+++ b/extensions/langchain4j-tokenizer/deployment/pom.xml
@@ -35,8 +35,8 @@
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core-deployment</artifactId>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
diff --git a/extensions/langchain4j-tokenizer/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/tokenizer/deployment/Langchain4jTokenizerProcessor.java b/extensions/langchain4j-tokenizer/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/tokenizer/deployment/Langchain4jTokenizerProcessor.java
index cae5281249..1b6d8a9822 100644
--- a/extensions/langchain4j-tokenizer/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/tokenizer/deployment/Langchain4jTokenizerProcessor.java
+++ b/extensions/langchain4j-tokenizer/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/tokenizer/deployment/Langchain4jTokenizerProcessor.java
@@ -17,16 +17,25 @@
package org.apache.camel.quarkus.component.langchain4j.tokenizer.deployment;
import java.lang.reflect.Modifier;
+import java.util.Set;
+import java.util.stream.Collectors;
import io.quarkus.deployment.GeneratedClassGizmoAdaptor;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.GeneratedClassBuildItem;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
import io.quarkus.gizmo.ClassCreator;
import io.quarkus.gizmo.MethodCreator;
import io.quarkus.gizmo.MethodDescriptor;
+import opennlp.tools.util.BaseToolFactory;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
class Langchain4jTokenizerProcessor {
private static final String FEATURE = "camel-langchain4j-tokenizer";
@@ -42,6 +51,30 @@ class Langchain4jTokenizerProcessor {
return new FeatureBuildItem(FEATURE);
}
+ @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
+ IndexDependencyBuildItem indexDependencies() {
+ return new IndexDependencyBuildItem("org.apache.opennlp", "opennlp-tools");
+ }
+
+ @BuildStep
+ NativeImageResourceBuildItem nativeImageResources() {
+ return new NativeImageResourceBuildItem("opennlp/opennlp-en-ud-ewt-sentence-1.2-2.5.0.bin");
+ }
+
+ @BuildStep
+ void registerForReflection(CombinedIndexBuildItem combinedIndex, BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
+ Set<String> opennlpToolFactories = combinedIndex.getIndex()
+ .getAllKnownSubclasses(BaseToolFactory.class)
+ .stream()
+ .map(ClassInfo::name)
+ .map(DotName::toString)
+ .collect(Collectors.toSet());
+ System.out.println(opennlpToolFactories);
+ reflectiveClass.produce(ReflectiveClassBuildItem.builder(opennlpToolFactories.toArray(new String[0]))
+ .methods()
+ .build());
+ }
+
@BuildStep(onlyIf = { NativeOrNativeSourcesBuild.class })
void generateNoOpLangchain4jTokenizer(BuildProducer<GeneratedClassBuildItem> generatedClass) {
// Generate NoOp impls of langchain4j tokenizers if some or all of the LLM model dependencies are not present
diff --git a/extensions/langchain4j-tokenizer/runtime/pom.xml b/extensions/langchain4j-tokenizer/runtime/pom.xml
index 9e79848265..f6434107fb 100644
--- a/extensions/langchain4j-tokenizer/runtime/pom.xml
+++ b/extensions/langchain4j-tokenizer/runtime/pom.xml
@@ -41,14 +41,14 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-tokenizer</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/extensions/langchain4j-web-search/deployment/pom.xml b/extensions/langchain4j-web-search/deployment/pom.xml
index 9f92cc591d..9b0d90b8b8 100644
--- a/extensions/langchain4j-web-search/deployment/pom.xml
+++ b/extensions/langchain4j-web-search/deployment/pom.xml
@@ -34,10 +34,19 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
+ <!-- TODO: Have a conditional dep for this or transform to JAX-RS -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-retrofit-deployment</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-web-search</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson-deployment</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/extensions/langchain4j-web-search/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/deployment/Langchain4jWebSearchProcessor.java b/extensions/langchain4j-web-search/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/deployment/Langchain4jWebSearchProcessor.java
index 60c647fc63..d19af52ed6 100644
--- a/extensions/langchain4j-web-search/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/deployment/Langchain4jWebSearchProcessor.java
+++ b/extensions/langchain4j-web-search/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/deployment/Langchain4jWebSearchProcessor.java
@@ -16,17 +16,79 @@
*/
package org.apache.camel.quarkus.component.langchain4j.web.search.deployment;
+import java.util.Set;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import io.quarkus.bootstrap.model.ApplicationModel;
+import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
import io.quarkus.deployment.builditem.FeatureBuildItem;
-import org.jboss.logging.Logger;
+import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem;
+import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
+import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
+import io.quarkus.maven.dependency.ResolvedDependency;
+import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
class Langchain4jWebSearchProcessor {
-
- private static final Logger LOG = Logger.getLogger(Langchain4jWebSearchProcessor.class);
private static final String FEATURE = "camel-langchain4j-web-search";
+ private static final Pattern WEB_SEARCH_API_CLASS_PATTERN = Pattern.compile(".*(Response|SearchRequest|SearchResult)");
@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}
+
+ @BuildStep
+ void indexDependencies(
+ BuildProducer<IndexDependencyBuildItem> indexedDependency,
+ CurateOutcomeBuildItem curateOutcome) {
+
+ // Index any dependencies with artifactId prefix langchain4j-web-search-engine
+ ApplicationModel applicationModel = curateOutcome.getApplicationModel();
+ for (ResolvedDependency dependency : applicationModel.getDependencies()) {
+ if (dependency.getGroupId().equals("dev.langchain4j")
+ && dependency.getArtifactId().startsWith("langchain4j-web-search-engine")) {
+ String artifactId = dependency.getArtifactId();
+ indexedDependency.produce(new IndexDependencyBuildItem(dependency.getGroupId(), artifactId));
+ }
+ }
+ }
+
+ @BuildStep
+ NativeImageProxyDefinitionBuildItem registerRestServiceProxies(CombinedIndexBuildItem combinedIndex) {
+ // If there are any retrofit2 REST service definitions, we need to register native proxy definitions for them
+ Set<String> restServiceClasses = combinedIndex.getIndex()
+ .getSubpackages("dev.langchain4j.web.search")
+ .stream()
+ .flatMap(thePackage -> combinedIndex.getIndex().getClassesInPackage(thePackage).stream())
+ .map(ClassInfo::asClass)
+ .filter(classInfo -> classInfo.annotations().stream().anyMatch(
+ annotationInstance -> annotationInstance.name().toString().startsWith("retrofit2.http")))
+ .map(ClassInfo::name)
+ .map(DotName::toString)
+ .collect(Collectors.toSet());
+ return new NativeImageProxyDefinitionBuildItem(restServiceClasses.toArray(new String[0]));
+ }
+
+ @BuildStep
+ ReflectiveClassBuildItem registerForReflection(CombinedIndexBuildItem combinedIndex) {
+ Set<String> webSearchApiClasses = combinedIndex.getIndex()
+ .getSubpackages("dev.langchain4j.web.search")
+ .stream()
+ .flatMap(thePackage -> combinedIndex.getIndex().getClassesInPackage(thePackage).stream())
+ .map(ClassInfo::asClass)
+ .map(ClassInfo::name)
+ .map(DotName::toString)
+ .filter(className -> WEB_SEARCH_API_CLASS_PATTERN.matcher(className).matches())
+ .collect(Collectors.toSet());
+
+ return ReflectiveClassBuildItem
+ .builder(webSearchApiClasses.toArray(new String[0]))
+ .fields(true)
+ .methods(true).build();
+ }
}
diff --git a/extensions/langchain4j-web-search/runtime/pom.xml b/extensions/langchain4j-web-search/runtime/pom.xml
index 4e9133f8b6..3e107f7bcd 100644
--- a/extensions/langchain4j-web-search/runtime/pom.xml
+++ b/extensions/langchain4j-web-search/runtime/pom.xml
@@ -41,10 +41,18 @@
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-retrofit</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-web-search</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson</artifactId>
+ </dependency>
</dependencies>
<build>
diff --git a/extensions/langchain4j/deployment/pom.xml b/extensions/langchain4j/deployment/pom.xml
deleted file mode 100644
index cec2618a56..0000000000
--- a/extensions/langchain4j/deployment/pom.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j-parent</artifactId>
- <version>3.27.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>camel-quarkus-langchain4j-deployment</artifactId>
- <name>Camel Quarkus :: langChain4j :: Deployment</name>
-
- <dependencies>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core-deployment</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-bean-deployment</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <annotationProcessorPaths>
- <path>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-extension-processor</artifactId>
- <version>${quarkus.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java b/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java
deleted file mode 100644
index 4d40dc4c95..0000000000
--- a/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain.chat.deployment;
-
-import java.util.List;
-
-import io.quarkiverse.langchain4j.deployment.DeclarativeAiServiceBuildItem;
-import io.quarkiverse.langchain4j.deployment.items.MethodParameterAllowedAnnotationsBuildItem;
-import io.quarkus.arc.deployment.UnremovableBeanBuildItem;
-import io.quarkus.deployment.annotations.BuildProducer;
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.builditem.FeatureBuildItem;
-
-import static io.quarkus.arc.deployment.UnremovableBeanBuildItem.beanClassNames;
-
-class LangChain4jProcessor {
- private static final String FEATURE = "camel-quarkus-langchain4j";
-
- @BuildStep
- FeatureBuildItem feature() {
- return new FeatureBuildItem(FEATURE);
- }
-
- @BuildStep
- MethodParameterAllowedAnnotationsBuildItem camelAnnotatedParametersCouldBeUsedAsTemplateVariable() {
- return new MethodParameterAllowedAnnotationsBuildItem(anno -> anno.name().toString().startsWith("org.apache.camel"));
- };
-
- @BuildStep
- void markAiServicesAsUnremovable(
- List<DeclarativeAiServiceBuildItem> aiServices, BuildProducer<UnremovableBeanBuildItem> unremovableBeans) {
- aiServices.stream().forEach(ai -> {
- unremovableBeans.produce(
- beanClassNames(ai.getServiceClassInfo().name().toString() + "$$QuarkusImpl"));
- });
- };
-}
diff --git a/extensions/langchain4j/pom.xml b/extensions/langchain4j/pom.xml
deleted file mode 100644
index 1eb57115c7..0000000000
--- a/extensions/langchain4j/pom.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-extensions</artifactId>
- <version>3.27.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>camel-quarkus-langchain4j-parent</artifactId>
- <name>Camel Quarkus :: langChain4j</name>
- <packaging>pom</packaging>
-
- <modules>
- <module>deployment</module>
- <module>runtime</module>
- </modules>
-</project>
diff --git a/extensions/langchain4j/runtime/pom.xml b/extensions/langchain4j/runtime/pom.xml
deleted file mode 100644
index ba593e6ab3..0000000000
--- a/extensions/langchain4j/runtime/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j-parent</artifactId>
- <version>3.27.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>camel-quarkus-langchain4j</artifactId>
- <name>Camel Quarkus :: langChain4j :: Runtime</name>
- <description>LangChain4j high level api usage with Camel Quarkus</description>
-
- <properties>
- <camel.quarkus.jvmSince>3.16.0</camel.quarkus.jvmSince>
- <camel.quarkus.nativeSince>3.16.0</camel.quarkus.nativeSince>
- <quarkus.metadata.status>experimental</quarkus.metadata.status>
- <quarkus.metadata.deprecated>true</quarkus.metadata.deprecated>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-bean</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-extension-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <annotationProcessorPaths>
- <path>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-extension-processor</artifactId>
- <version>${quarkus.version}</version>
- </path>
- </annotationProcessorPaths>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git a/extensions/langchain4j/runtime/src/main/doc/configuration.adoc b/extensions/langchain4j/runtime/src/main/doc/configuration.adoc
deleted file mode 100644
index d63695cf7e..0000000000
--- a/extensions/langchain4j/runtime/src/main/doc/configuration.adoc
+++ /dev/null
@@ -1,75 +0,0 @@
-=== Using camel annotations from LangChain4j AI service method parameters
-
-The `camel-quarkus-langchain4j` extension makes it possible to use camel parameter binding annotations with LangChain4j AI services.
-
-For example:
-
-[source,java]
-----
-@RegisterAiService
-@ApplicationScoped
-public interface CustomAiService {
- @UserMessage("An LLM prompt that can use the method parameter {myHeaderInjectedIntoPrompt}.")
- @Handler
- String invokeLlm(@Header("myHeaderName") String myHeaderInjectedIntoPrompt);
-}
-----
-
-You can find more details about Camel Parameter Binding annotations in the xref:manual::parameter-binding-annotations.adoc[manual].
-
-=== Resolving AI services by interface
-
-With the `camel-quarkus-langchain4j` extension, the AI services are resolvable by interface when called from a `bean` statement.
-
-For instance, let's define an AI service below:
-
-[source,java]
-----
-@ApplicationScoped
-@RegisterAiService
-public interface MyAiService {
- @UserMessage("My Prompt")
- @Handler
- String chat(String question);
-}
-----
-
-The AI service could then be invoked from a Camel route like this:
-
-[source,java]
-----
-@Override
-public void configure() {
- from("...")
- .bean(MyAiService.class);
-}
-----
-
-=== Resolving AI services by bean name
-
-The AI services are also resolvable by bean name when called from a `bean` statement.
-
-For instance, let's define an AI service below:
-
-[source,java]
-----
-@ApplicationScoped
-@Named("aiServiceResolvedByName")
-@RegisterAiService
-public interface AiServiceResolvedByName {
- @UserMessage("My prompt")
- @Handler
- String chatByName(String input);
-}
-----
-
-The AI service could then be invoked from a Camel route as below:
-
-[source,java]
-----
-@Override
-public void configure() {
- from("...")
- .bean("aiServiceResolvedByName");
-}
-----
diff --git a/extensions/langchain4j/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/langchain4j/runtime/src/main/resources/META-INF/quarkus-extension.yaml
deleted file mode 100644
index 78f940ca9d..0000000000
--- a/extensions/langchain4j/runtime/src/main/resources/META-INF/quarkus-extension.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You 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.
-#
-
-# This is a generated file. Do not edit directly!
-# To re-generate, run the following command from the top level directory:
-#
-# mvn -N cq:update-quarkus-metadata
-#
----
-name: "Camel langChain4j"
-description: "LangChain4j high level api usage with Camel Quarkus"
-metadata:
- icon-url: "https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
- sponsor: "Apache Software Foundation"
- guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/langchain4j.html"
- categories:
- - "integration"
- status:
- - "experimental"
- - "deprecated"
\ No newline at end of file
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 0a91d71ac6..32c7e01aa5 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -172,7 +172,6 @@
<module>kubernetes</module>
<module>kubernetes-cluster-service</module>
<module>kudu</module>
- <module>langchain4j</module>
<module>langchain4j-chat</module>
<module>langchain4j-tokenizer</module>
<module>langchain4j-tools</module>
diff --git a/integration-tests/langchain4j-chat/pom.xml b/integration-tests/langchain4j-chat/pom.xml
index 56da80d5d0..f772c07474 100644
--- a/integration-tests/langchain4j-chat/pom.xml
+++ b/integration-tests/langchain4j-chat/pom.xml
@@ -48,8 +48,16 @@
<artifactId>quarkus-rest</artifactId>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-ollama</artifactId>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-ollama</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-retrofit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-jackson</artifactId>
</dependency>
<!-- test dependencies -->
@@ -119,6 +127,19 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-support-retrofit-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</profile>
<profile>
diff --git a/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/LangChain4jChatResource.java b/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/LangChain4jChatResource.java
index aee3bcd038..2eec7351ad 100644
--- a/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/LangChain4jChatResource.java
+++ b/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/LangChain4jChatResource.java
@@ -25,8 +25,12 @@ import dev.langchain4j.data.message.AiMessage;
import dev.langchain4j.data.message.ChatMessage;
import dev.langchain4j.data.message.SystemMessage;
import dev.langchain4j.data.message.UserMessage;
+import dev.langchain4j.model.chat.ChatModel;
+import dev.langchain4j.model.ollama.OllamaChatModel;
import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;
+import jakarta.inject.Named;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.QueryParam;
@@ -36,6 +40,7 @@ import org.apache.camel.ProducerTemplate;
import org.apache.camel.component.langchain4j.chat.LangChain4jChat;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.util.ObjectHelper;
+import org.eclipse.microprofile.config.ConfigProvider;
@Path("/langchain4j-chat")
@ApplicationScoped
@@ -118,4 +123,24 @@ public class LangChain4jChatResource {
return Response.ok().build();
}
+
+ @Produces
+ @Named("m1")
+ ChatModel model() {
+ return OllamaChatModel.builder()
+ .baseUrl(ConfigProvider.getConfig().getValue("quarkus.langchain4j.ollama.base-url", String.class))
+ .modelName("orca-mini")
+ .temperature(0.3)
+ .build();
+ }
+
+ @Produces
+ @Named("m2")
+ ChatModel model2() {
+ return OllamaChatModel.builder()
+ .baseUrl(ConfigProvider.getConfig().getValue("quarkus.langchain4j.ollama.base-url", String.class))
+ .modelName("orca-mini")
+ .temperature(0.3)
+ .build();
+ }
}
diff --git a/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/OllamaRoute.java b/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/OllamaRoute.java
index c2f5a8124f..e08d0af80f 100644
--- a/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/OllamaRoute.java
+++ b/integration-tests/langchain4j-chat/src/main/java/org/apache/camel/quarkus/component/langchain/chat/it/OllamaRoute.java
@@ -24,15 +24,15 @@ public class OllamaRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
from("direct:send-simple-message?timeout=30000")
- .to("langchain4j-chat:test1?chatOperation=CHAT_SINGLE_MESSAGE")
+ .to("langchain4j-chat:test1?chatOperation=CHAT_SINGLE_MESSAGE&chatModel=#m1")
.to("mock:simpleMessageResponse");
from("direct:send-message-prompt?timeout=30000")
- .to("langchain4j-chat:test2?chatOperation=CHAT_SINGLE_MESSAGE_WITH_PROMPT")
+ .to("langchain4j-chat:test2?chatOperation=CHAT_SINGLE_MESSAGE_WITH_PROMPT&chatModel=#m1")
.to("mock:messagePromptResponse");
from("direct:send-multiple?timeout=30000")
- .to("langchain4j-chat:test3?chatOperation=CHAT_MULTIPLE_MESSAGES")
+ .to("langchain4j-chat:test3?chatOperation=CHAT_MULTIPLE_MESSAGES&chatModel=#m1")
.to("mock:multipleMessageResponse");
from("direct:send-simple-message-m1")
diff --git a/integration-tests/langchain4j-chat/src/main/resources/application.properties b/integration-tests/langchain4j-chat/src/main/resources/application.properties
deleted file mode 100644
index 4b97d6c825..0000000000
--- a/integration-tests/langchain4j-chat/src/main/resources/application.properties
+++ /dev/null
@@ -1,35 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements. See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You 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.
-## ---------------------------------------------------------------------------
-quarkus.langchain4j.ollama.chat-model.model-name=orca-mini
-quarkus.langchain4j.ollama.chat-model.temperature=0.3
-quarkus.langchain4j.ollama.timeout=30s
-quarkus.devservices.enabled=false
-
-quarkus.langchain4j.m1.chat-model.provider=ollama
-quarkus.langchain4j.ollama.m1.base-url=${quarkus.langchain4j.ollama.base-url}
-quarkus.langchain4j.ollama.m1.chat-model.model-name=orca-mini
-quarkus.langchain4j.ollama.m1.chat-model.temperature = 0.3
-
-quarkus.langchain4j.m2.chat-model.provider=ollama
-quarkus.langchain4j.ollama.m2.base-url=${quarkus.langchain4j.ollama.base-url}
-quarkus.langchain4j.ollama.m2.chat-model.model-name=orca-mini
-quarkus.langchain4j.ollama.m2.chat-model.temperature = 0.3
-
-# Uncomment to log HTTP traffic between langchain4j & the LLM API
-#quarkus.rest-client.logging.scope=request-response
-#quarkus.rest-client.logging.body-limit=10000
-#quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-209afadc-b5a5-4421-a5ed-12df7022ee83.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-209afadc-b5a5-4421-a5ed-12df7022ee83.json
new file mode 100644
index 0000000000..6ea8290f68
--- /dev/null
+++ b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-209afadc-b5a5-4421-a5ed-12df7022ee83.json
@@ -0,0 +1,27 @@
+{
+ "id" : "209afadc-b5a5-4421-a5ed-12df7022ee83",
+ "name" : "api_chat",
+ "request" : {
+ "url" : "/api/chat",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"user\",\n \"content\" : \"Hello my name is Darth Vader!\"\n } ],\n \"options\" : {\n \"temperature\" : 0.3\n },\n \"stream\" : false\n}",
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2025-07-03T12:23:40.200733369Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Hello, I am your loyal AI assistant. Is there anything I can assist you with today?\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":974483342,\"load_duration\":5203531,\"prompt_eval_count\":49,\"prompt_eval_duration\":48645877,\"eval_count\":20,\"eval_duration\":919787081}",
+ "headers" : {
+ "Date" : "Thu, 03 Jul 2025 12:23:40 GMT",
+ "Content-Type" : "application/json; charset=utf-8"
+ }
+ },
+ "uuid" : "209afadc-b5a5-4421-a5ed-12df7022ee83",
+ "persistent" : true,
+ "scenarioName" : "scenario-1-api-chat",
+ "requiredScenarioState" : "scenario-1-api-chat-2",
+ "newScenarioState" : "scenario-1-api-chat-3",
+ "insertionIndex" : 4
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/multipleMessages.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-26bc7007-3e10-45a9-90f1-aa22c18fe23a.json
similarity index 59%
rename from integration-tests/langchain4j-chat/src/test/resources/mappings/multipleMessages.json
rename to integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-26bc7007-3e10-45a9-90f1-aa22c18fe23a.json
index ae4155d28c..73ad831941 100644
--- a/integration-tests/langchain4j-chat/src/test/resources/mappings/multipleMessages.json
+++ b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-26bc7007-3e10-45a9-90f1-aa22c18fe23a.json
@@ -1,24 +1,24 @@
{
- "id" : "dd4c47e5-d189-437f-b4fb-cdb3007d6271",
+ "id" : "26bc7007-3e10-45a9-90f1-aa22c18fe23a",
"name" : "api_chat",
"request" : {
"url" : "/api/chat",
"method" : "POST",
"bodyPatterns" : [ {
- "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"system\",\n \"content\" : \"You are asked to provide recommendations for a restaurant based on user reviews.\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"Hello, my name is Karen.\"\n }, {\n \"role\" : \"assistant\",\n \"content\" : \"Hello Karen, how can I help you?\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"I'd like you to recommend a restaurant for me.\"\n [...]
+ "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"system\",\n \"content\" : \"You are asked to provide recommendations for a restaurant based on user reviews.\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"Hello, my name is Karen.\"\n }, {\n \"role\" : \"assistant\",\n \"content\" : \"Hello Karen, how can I help you?\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"I'd like you to recommend a restaurant for me.\"\n [...]
"ignoreArrayOrder" : true,
"ignoreExtraElements" : true
} ]
},
"response" : {
"status" : 200,
- "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2024-07-22T09:22:54.577581434Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Based on user reviews, I would recommend La Petite Farine. It has received excellent ratings for Moroccan cuisine and has a great atmosphere. Customers rave about the delicious food and the friendly service. Check it out at https://www.restaurant-la-petite-farine.com/\"},\"done\":true,\"total_duration\":3301943840,\"load_duration\":356730,\"prompt_ev [...]
+ "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2025-07-03T12:23:57.641289281Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Based on user reviews, I would recommend La Terrasse d'Alain Ducasse au Plaza Athenee in Paris, Rue Montorgueil. It has an average rating of 4.5 stars and has received positive feedback from customers for its delicious food and stunning views of the city.\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":4640632664,\"load_duration\":504724 [...]
"headers" : {
- "Date" : "Mon, 22 Jul 2024 09:22:54 GMT",
+ "Date" : "Thu, 03 Jul 2025 12:23:57 GMT",
"Content-Type" : "application/json; charset=utf-8"
}
},
- "uuid" : "dd4c47e5-d189-437f-b4fb-cdb3007d6271",
+ "uuid" : "26bc7007-3e10-45a9-90f1-aa22c18fe23a",
"persistent" : true,
- "insertionIndex" : 3
+ "insertionIndex" : 1
}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-6295474b-b951-49fb-be50-dbe0aa93fa0c.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-6295474b-b951-49fb-be50-dbe0aa93fa0c.json
new file mode 100644
index 0000000000..da0c967ea9
--- /dev/null
+++ b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-6295474b-b951-49fb-be50-dbe0aa93fa0c.json
@@ -0,0 +1,27 @@
+{
+ "id" : "6295474b-b951-49fb-be50-dbe0aa93fa0c",
+ "name" : "api_chat",
+ "request" : {
+ "url" : "/api/chat",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"user\",\n \"content\" : \"Hello my name is Darth Vader!\"\n } ],\n \"options\" : {\n \"temperature\" : 0.3\n },\n \"stream\" : false\n}",
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2025-07-03T12:23:39.069612172Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Hello, I am your loyal AI assistant. Is there anything I can assist you with today?\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":1373187042,\"load_duration\":5337644,\"prompt_eval_count\":49,\"prompt_eval_duration\":446121004,\"eval_count\":20,\"eval_duration\":920823050}",
+ "headers" : {
+ "Date" : "Thu, 03 Jul 2025 12:23:39 GMT",
+ "Content-Type" : "application/json; charset=utf-8"
+ }
+ },
+ "uuid" : "6295474b-b951-49fb-be50-dbe0aa93fa0c",
+ "persistent" : true,
+ "scenarioName" : "scenario-1-api-chat",
+ "requiredScenarioState" : "Started",
+ "newScenarioState" : "scenario-1-api-chat-2",
+ "insertionIndex" : 5
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-a2a5aabd-ef52-4fc3-84a3-6e6f1bd7ce93.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-a2a5aabd-ef52-4fc3-84a3-6e6f1bd7ce93.json
new file mode 100644
index 0000000000..4d891232d7
--- /dev/null
+++ b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-a2a5aabd-ef52-4fc3-84a3-6e6f1bd7ce93.json
@@ -0,0 +1,24 @@
+{
+ "id" : "a2a5aabd-ef52-4fc3-84a3-6e6f1bd7ce93",
+ "name" : "api_chat",
+ "request" : {
+ "url" : "/api/chat",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"user\",\n \"content\" : \"Create a recipe for a oven dish with the following ingredients: potato, tomato, feta, olive oil\"\n } ],\n \"options\" : {\n \"temperature\" : 0.3\n },\n \"stream\" : false\n}",
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2025-07-03T12:23:52.914650649Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Sure! Here's a simple recipe for a oven dish with potato, tomato, feta, and olive oil:\\n\\nIngredients:\\n- 1 medium-sized potato, peeled and chopped into small pieces\\n- 1 medium-sized tomato, chopped\\n- 1/2 cup crumbled feta cheese\\n- 2 tablespoons olive oil\\n\\nInstructions:\\n1. Preheat the oven to 375°F (190°C).\\n2. In a baking dish, arran [...]
+ "headers" : {
+ "Date" : "Thu, 03 Jul 2025 12:23:52 GMT",
+ "Content-Type" : "application/json; charset=utf-8"
+ }
+ },
+ "uuid" : "a2a5aabd-ef52-4fc3-84a3-6e6f1bd7ce93",
+ "persistent" : true,
+ "insertionIndex" : 2
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-cff406ca-7bff-4de8-ac45-693be8a005e0.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-cff406ca-7bff-4de8-ac45-693be8a005e0.json
new file mode 100644
index 0000000000..1a92d3a346
--- /dev/null
+++ b/integration-tests/langchain4j-chat/src/test/resources/mappings/api_chat-cff406ca-7bff-4de8-ac45-693be8a005e0.json
@@ -0,0 +1,26 @@
+{
+ "id" : "cff406ca-7bff-4de8-ac45-693be8a005e0",
+ "name" : "api_chat",
+ "request" : {
+ "url" : "/api/chat",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"user\",\n \"content\" : \"Hello my name is Darth Vader!\"\n } ],\n \"options\" : {\n \"temperature\" : 0.3\n },\n \"stream\" : false\n}",
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2025-07-03T12:23:41.212136413Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Hello, I am your loyal AI assistant. Is there anything I can assist you with today?\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":973128813,\"load_duration\":4831151,\"prompt_eval_count\":49,\"prompt_eval_duration\":48797492,\"eval_count\":20,\"eval_duration\":918658216}",
+ "headers" : {
+ "Date" : "Thu, 03 Jul 2025 12:23:41 GMT",
+ "Content-Type" : "application/json; charset=utf-8"
+ }
+ },
+ "uuid" : "cff406ca-7bff-4de8-ac45-693be8a005e0",
+ "persistent" : true,
+ "scenarioName" : "scenario-1-api-chat",
+ "requiredScenarioState" : "scenario-1-api-chat-3",
+ "insertionIndex" : 3
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/promptMessage.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/promptMessage.json
deleted file mode 100644
index 94f7328ddb..0000000000
--- a/integration-tests/langchain4j-chat/src/test/resources/mappings/promptMessage.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "id" : "7a17ef92-ee87-4291-a924-40289295573d",
- "name" : "api_chat",
- "request" : {
- "url" : "/api/chat",
- "method" : "POST",
- "bodyPatterns" : [ {
- "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"user\",\n \"content\" : \"Create a recipe for a oven dish with the following ingredients: potato, tomato, feta, olive oil\"\n } ],\n \"options\" : {\n \"temperature\" : 0.3,\n \"top_k\" : 40,\n \"top_p\" : 0.9\n },\n \"stream\" : false\n}",
- "ignoreArrayOrder" : true,
- "ignoreExtraElements" : true
- } ]
- },
- "response" : {
- "status" : 200,
- "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2024-07-22T09:14:41.627539463Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Here's a simple recipe for a delicious oven dish with potatoes, tomato, feta and olive oil:\\n\\nIngredients:\\n- 2 medium-sized potatoes, peeled and chopped into small pieces\\n- 1 medium-sized tomato, chopped\\n- 1/2 cup crumbled feta cheese\\n- 2 tablespoons olive oil\\n\\nInstructions:\\n\\n1. Preheat the oven to 375°F (190°C).\\n\\n2. In a bakin [...]
- "headers" : {
- "Date" : "Mon, 22 Jul 2024 09:14:41 GMT",
- "Content-Type" : "application/json; charset=utf-8"
- }
- },
- "uuid" : "7a17ef92-ee87-4291-a924-40289295573d",
- "persistent" : true,
- "insertionIndex" : 3
-}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-chat/src/test/resources/mappings/simpleMessage.json b/integration-tests/langchain4j-chat/src/test/resources/mappings/simpleMessage.json
deleted file mode 100644
index 75231cd4b8..0000000000
--- a/integration-tests/langchain4j-chat/src/test/resources/mappings/simpleMessage.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "id" : "4b34d025-3895-4bd9-80f9-dce99fad4012",
- "name" : "api_chat",
- "request" : {
- "url" : "/api/chat",
- "method" : "POST",
- "bodyPatterns" : [ {
- "equalToJson" : "{\n \"model\" : \"orca-mini\",\n \"messages\" : [ {\n \"role\" : \"user\",\n \"content\" : \"Hello my name is Darth Vader!\"\n } ],\n \"options\" : {\n \"temperature\" : 0.3,\n \"top_k\" : 40,\n \"top_p\" : 0.9\n },\n \"stream\" : false\n}",
- "ignoreArrayOrder" : true,
- "ignoreExtraElements" : true
- } ]
- },
- "response" : {
- "status" : 200,
- "body" : "{\"model\":\"orca-mini\",\"created_at\":\"2024-07-22T09:15:12.778157441Z\",\"message\":{\"role\":\"assistant\",\"content\":\" Hello, I am your loyal AI assistant. Is there anything I can assist you with today?\"},\"done\":true,\"total_duration\":1277036396,\"load_duration\":576934,\"prompt_eval_count\":16,\"prompt_eval_duration\":324714000,\"eval_count\":20,\"eval_duration\":950928000}",
- "headers" : {
- "Date" : "Mon, 22 Jul 2024 09:15:12 GMT",
- "Content-Type" : "application/json; charset=utf-8"
- }
- },
- "uuid" : "4b34d025-3895-4bd9-80f9-dce99fad4012",
- "persistent" : true,
- "insertionIndex" : 3
-}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-tokenizer/pom.xml b/integration-tests/langchain4j-tokenizer/pom.xml
index 3d1dcc2861..4bd25cb192 100644
--- a/integration-tests/langchain4j-tokenizer/pom.xml
+++ b/integration-tests/langchain4j-tokenizer/pom.xml
@@ -44,8 +44,8 @@
<artifactId>camel-quarkus-mock</artifactId>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-openai</artifactId>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-open-ai</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
diff --git a/integration-tests/langchain4j-tools/pom.xml b/integration-tests/langchain4j-tools/pom.xml
index 9cd7c12820..a53b7e2e45 100644
--- a/integration-tests/langchain4j-tools/pom.xml
+++ b/integration-tests/langchain4j-tools/pom.xml
@@ -52,8 +52,8 @@
<artifactId>quarkus-rest</artifactId>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-ollama</artifactId>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-ollama</artifactId>
</dependency>
<!-- test dependencies -->
diff --git a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jRoute.java b/integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsProducers.java
similarity index 55%
copy from integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jRoute.java
copy to integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsProducers.java
index 2535daafc2..73e1aa78b6 100644
--- a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jRoute.java
+++ b/integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsProducers.java
@@ -14,28 +14,28 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.component.langchain.it;
+package org.apache.camel.quarkus.component.langchain4j.tools.it;
+import java.time.Duration;
+
+import dev.langchain4j.model.chat.ChatModel;
+import dev.langchain4j.model.ollama.OllamaChatModel;
import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import org.apache.camel.builder.RouteBuilder;
+import jakarta.enterprise.inject.Produces;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
@ApplicationScoped
-public class LangChain4jRoute extends RouteBuilder {
-
- @Inject
- MirrorAiService mirrorAiService;
-
- @Override
- public void configure() {
- from("direct:camel-annotations-should-work-as-expected")
- .setHeader("headerName", constant("headerValue"))
- .bean(mirrorAiService);
-
- from("direct:ai-service-should-be-resolvable-by-interface")
- .bean(AiServiceResolvedByInterface.class);
+public class Langchain4jToolsProducers {
+ @ConfigProperty(name = "langchain4j.ollama.base-url")
+ String ollamaBaseUrl;
- from("direct:ai-service-should-be-resolvable-by-name")
- .bean("aiServiceResolvedByName");
+ @Produces
+ ChatModel chatModel() {
+ return new OllamaChatModel.OllamaChatModelBuilder()
+ .baseUrl(ollamaBaseUrl)
+ .modelName("llama3.1")
+ .temperature(0.0)
+ .timeout(Duration.ofSeconds(30))
+ .build();
}
}
diff --git a/integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsRoutes.java b/integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsRoutes.java
index 54411fa114..b377206519 100644
--- a/integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsRoutes.java
+++ b/integration-tests/langchain4j-tools/src/main/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsRoutes.java
@@ -16,7 +16,7 @@
*/
package org.apache.camel.quarkus.component.langchain4j.tools.it;
-import com.fasterxml.jackson.databind.node.TextNode;
+import com.fasterxml.jackson.databind.node.IntNode;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.builder.RouteBuilder;
@@ -37,8 +37,8 @@ public class Langchain4jToolsRoutes extends RouteBuilder {
// TODO: Investigate removing this with Camel >= 4.13
Message message = exchange.getMessage();
Object header = message.getHeader("user_id");
- if (header instanceof TextNode) {
- message.setHeader("user_id", ((TextNode) header).asInt());
+ if (header instanceof IntNode) {
+ message.setHeader("user_id", ((IntNode) header).asInt());
}
}
}
diff --git a/integration-tests/langchain4j-tools/src/main/resources/application.properties b/integration-tests/langchain4j-tools/src/main/resources/application.properties
index 7ea68a2a55..b6f6207707 100644
--- a/integration-tests/langchain4j-tools/src/main/resources/application.properties
+++ b/integration-tests/langchain4j-tools/src/main/resources/application.properties
@@ -18,14 +18,3 @@ quarkus.native.resources.includes=sql/*
quarkus.datasource.db-kind=h2
quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test
-
-quarkus.langchain4j.chat-model.provider=ollama
-quarkus.langchain4j.ollama.devservices.enabled=false
-quarkus.langchain4j.ollama.chat-model.model-name=llama3.1
-quarkus.langchain4j.ollama.chat-model.temperature=0
-quarkus.langchain4j.ollama.timeout=30s
-
-# Uncomment to log HTTP traffic between langchain4j & the LLM API
-#quarkus.rest-client.logging.scope=request-response
-#quarkus.rest-client.logging.body-limit=10000
-#quarkus.log.category."org.jboss.resteasy.reactive.client.logging".level=DEBUG
diff --git a/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsTest.java b/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsTest.java
index 541e6e2848..5d4564596a 100644
--- a/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsTest.java
+++ b/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/Langchain4jToolsTest.java
@@ -24,8 +24,8 @@ import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.is;
-@QuarkusTestResource(OllamaTestResource.class)
@QuarkusTestResource(H2DatabaseTestResource.class)
+@QuarkusTestResource(OllamaTestResource.class)
@QuarkusTest
class Langchain4jToolsTest {
diff --git a/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/OllamaTestResource.java b/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/OllamaTestResource.java
index f03cfefe2b..4ef3d8c80e 100644
--- a/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/OllamaTestResource.java
+++ b/integration-tests/langchain4j-tools/src/test/java/org/apache/camel/quarkus/component/langchain4j/tools/it/OllamaTestResource.java
@@ -21,14 +21,14 @@ import java.util.Map;
import org.apache.camel.quarkus.test.wiremock.WireMockTestResourceLifecycleManager;
public class OllamaTestResource extends WireMockTestResourceLifecycleManager {
- private static final String OLLAMA_ENV_URL = "QUARKUS_LANGCHAIN4J_OLLAMA_BASE_URL";
+ private static final String OLLAMA_ENV_URL = "LANGCHAIN4J_OLLAMA_BASE_URL";
@Override
public Map<String, String> start() {
Map<String, String> properties = super.start();
String wiremockUrl = properties.get("wiremock.url");
String url = wiremockUrl != null ? wiremockUrl : getRecordTargetBaseUrl();
- properties.put("quarkus.langchain4j.ollama.base-url", url);
+ properties.put("langchain4j.ollama.base-url", url);
return properties;
}
diff --git a/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-3a96d932-0bd9-45c0-8482-0fdc0cc67243.json b/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-3a96d932-0bd9-45c0-8482-0fdc0cc67243.json
new file mode 100644
index 0000000000..84bc5b413d
--- /dev/null
+++ b/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-3a96d932-0bd9-45c0-8482-0fdc0cc67243.json
@@ -0,0 +1,26 @@
+{
+ "id" : "3a96d932-0bd9-45c0-8482-0fdc0cc67243",
+ "name" : "api_chat",
+ "request" : {
+ "url" : "/api/chat",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"model\" : \"llama3.1\",\n \"messages\" : [ {\n \"role\" : \"system\",\n \"content\" : \"You provide information about a specific user name by querying a database users table using the given user_id column value. Respond with the text in the format: The user name is <the users name here>\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"What is the name of the user with ID 1\"\n }, {\n \"role\" : \"assistant\",\n \"tool_calls\" : [ {\n [...]
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"model\":\"llama3.1\",\"created_at\":\"2025-08-06T14:14:31.249582295Z\",\"message\":{\"role\":\"assistant\",\"content\":\"The user name is Alice Smith.\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":2185308900,\"load_duration\":17768479,\"prompt_eval_count\":148,\"prompt_eval_duration\":1397666550,\"eval_count\":8,\"eval_duration\":768664286}",
+ "headers" : {
+ "Date" : "Wed, 06 Aug 2025 14:14:31 GMT",
+ "Content-Type" : "application/json; charset=utf-8"
+ }
+ },
+ "uuid" : "3a96d932-0bd9-45c0-8482-0fdc0cc67243",
+ "persistent" : true,
+ "insertionIndex" : 1,
+ "scenarioName": "LLMChat",
+ "requiredScenarioState": "end"
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-58a8c909-b8c3-4e57-946a-110a8c6a6fab.json b/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-58a8c909-b8c3-4e57-946a-110a8c6a6fab.json
new file mode 100644
index 0000000000..afa74f7c87
--- /dev/null
+++ b/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-58a8c909-b8c3-4e57-946a-110a8c6a6fab.json
@@ -0,0 +1,27 @@
+{
+ "id" : "58a8c909-b8c3-4e57-946a-110a8c6a6fab",
+ "name" : "api_chat",
+ "request" : {
+ "url" : "/api/chat",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"model\" : \"llama3.1\",\n \"messages\" : [ {\n \"role\" : \"system\",\n \"content\" : \"You provide information about a specific user name by querying a database users table using the given user_id column value. Respond with the text in the format: The user name is <the users name here>\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"What is the name of the user with ID 1\"\n } ],\n \"options\" : {\n \"temperature\" : 0.0,\n \"stop\" [...]
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"model\":\"llama3.1\",\"created_at\":\"2025-08-06T14:14:28.870376477Z\",\"message\":{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"function\":{\"name\":\"QueryDatabaseByUserID\",\"arguments\":{\"user_id\":1}}}]},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":9952193345,\"load_duration\":2757235223,\"prompt_eval_count\":206,\"prompt_eval_duration\":5107005332,\"eval_count\":20,\"eval_duration\":2086690234}",
+ "headers" : {
+ "Date" : "Wed, 06 Aug 2025 14:14:28 GMT",
+ "Content-Type" : "application/json; charset=utf-8"
+ }
+ },
+ "uuid" : "58a8c909-b8c3-4e57-946a-110a8c6a6fab",
+ "persistent" : true,
+ "insertionIndex" : 2,
+ "scenarioName": "LLMChat",
+ "requiredScenarioState": "Started",
+ "newScenarioState": "end"
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-717dbfe1-7c7e-4efc-b890-8e0d331dbad0.json b/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-717dbfe1-7c7e-4efc-b890-8e0d331dbad0.json
deleted file mode 100644
index ac8eeb5647..0000000000
--- a/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-717dbfe1-7c7e-4efc-b890-8e0d331dbad0.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "priority": 1,
- "id" : "717dbfe1-7c7e-4efc-b890-8e0d331dbad0",
- "name" : "api_chat",
- "request" : {
- "url" : "/api/chat",
- "method" : "POST",
- "bodyPatterns" : [ {
- "equalToJson" : "{\n \"model\" : \"llama3.1\",\n \"messages\" : [ {\n \"role\" : \"system\",\n \"content\" : \"You provide information about a specific user name by querying a database users table using the given user_id column value. Respond with the text in the format: The user name is <the users name here>\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"What is the name of the user with ID 1\"\n }, {\n \"role\" : \"assistant\",\n \"tool_calls\" : [ {\n [...]
- "ignoreArrayOrder" : true,
- "ignoreExtraElements" : true
- } ]
- },
- "response" : {
- "status" : 200,
- "body" : "{\"model\":\"llama3.1\",\"created_at\":\"2025-06-12T10:36:26.131167945Z\",\"message\":{\"role\":\"assistant\",\"content\":\"The user name is Alice Smith.\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":2181056808,\"load_duration\":19068383,\"prompt_eval_count\":148,\"prompt_eval_duration\":1394680209,\"eval_count\":8,\"eval_duration\":766038145}",
- "headers" : {
- "Date" : "Thu, 12 Jun 2025 10:36:26 GMT",
- "Content-Type" : "application/json; charset=utf-8"
- }
- },
- "uuid" : "717dbfe1-7c7e-4efc-b890-8e0d331dbad0",
- "persistent" : true,
- "insertionIndex" : 1
-}
diff --git a/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-f1009e50-53fa-4a9e-98d7-deaca89c803a.json b/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-f1009e50-53fa-4a9e-98d7-deaca89c803a.json
deleted file mode 100644
index aa993d119c..0000000000
--- a/integration-tests/langchain4j-tools/src/test/resources/mappings/api_chat-f1009e50-53fa-4a9e-98d7-deaca89c803a.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "priority": 2,
- "id" : "f1009e50-53fa-4a9e-98d7-deaca89c803a",
- "name" : "api_chat",
- "request" : {
- "url" : "/api/chat",
- "method" : "POST",
- "bodyPatterns" : [ {
- "equalToJson" : "{\n \"model\" : \"llama3.1\",\n \"messages\" : [ {\n \"role\" : \"system\",\n \"content\" : \"You provide information about a specific user name by querying a database users table using the given user_id column value. Respond with the text in the format: The user name is <the users name here>\"\n }, {\n \"role\" : \"user\",\n \"content\" : \"What is the name of the user with ID 1\"\n } ],\n \"tools\" : [ {\n \"type\" : \"function\",\n \"funct [...]
- "ignoreArrayOrder" : true,
- "ignoreExtraElements" : true
- } ]
- },
- "response" : {
- "status" : 200,
- "body" : "{\"model\":\"llama3.1\",\"created_at\":\"2025-06-12T10:36:23.85097169Z\",\"message\":{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"function\":{\"name\":\"QueryDatabaseByUserID\",\"arguments\":{\"user_id\":\"1\"}}}]},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":4692709078,\"load_duration\":18277214,\"prompt_eval_count\":197,\"prompt_eval_duration\":2589657825,\"eval_count\":20,\"eval_duration\":2083837747}",
- "headers" : {
- "Date" : "Thu, 12 Jun 2025 10:36:23 GMT",
- "Content-Type" : "application/json; charset=utf-8"
- }
- },
- "uuid" : "f1009e50-53fa-4a9e-98d7-deaca89c803a",
- "persistent" : true,
- "insertionIndex" : 2
-}
diff --git a/integration-tests/langchain4j-web-search/pom.xml b/integration-tests/langchain4j-web-search/pom.xml
index baba8d39c6..4f2b53c91e 100644
--- a/integration-tests/langchain4j-web-search/pom.xml
+++ b/integration-tests/langchain4j-web-search/pom.xml
@@ -44,8 +44,8 @@
<artifactId>quarkus-rest</artifactId>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-tavily</artifactId>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-web-search-engine-tavily</artifactId>
</dependency>
<!-- test dependencies -->
diff --git a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jRoute.java b/integration-tests/langchain4j-web-search/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/Langchain4jWebSearchProducers.java
similarity index 51%
rename from integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jRoute.java
rename to integration-tests/langchain4j-web-search/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/Langchain4jWebSearchProducers.java
index 2535daafc2..6aa6e3fa06 100644
--- a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jRoute.java
+++ b/integration-tests/langchain4j-web-search/src/main/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/Langchain4jWebSearchProducers.java
@@ -14,28 +14,31 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.quarkus.component.langchain.it;
+package org.apache.camel.quarkus.component.langchain4j.web.search.it;
+import java.util.Optional;
+
+import dev.langchain4j.web.search.WebSearchEngine;
+import dev.langchain4j.web.search.tavily.TavilyWebSearchEngine;
import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import org.apache.camel.builder.RouteBuilder;
+import jakarta.enterprise.inject.Produces;
+import org.eclipse.microprofile.config.inject.ConfigProperty;
@ApplicationScoped
-public class LangChain4jRoute extends RouteBuilder {
-
- @Inject
- MirrorAiService mirrorAiService;
-
- @Override
- public void configure() {
- from("direct:camel-annotations-should-work-as-expected")
- .setHeader("headerName", constant("headerValue"))
- .bean(mirrorAiService);
+public class Langchain4jWebSearchProducers {
+ @ConfigProperty(name = "langchain4j.tavily.api-key")
+ String tavilyApiKey;
- from("direct:ai-service-should-be-resolvable-by-interface")
- .bean(AiServiceResolvedByInterface.class);
+ @ConfigProperty(name = "langchain4j.tavily.base-url")
+ Optional<String> tavilyBaseUrl;
- from("direct:ai-service-should-be-resolvable-by-name")
- .bean("aiServiceResolvedByName");
+ @Produces
+ WebSearchEngine webSearchEngine() {
+ return TavilyWebSearchEngine.builder()
+ .apiKey(tavilyApiKey)
+ .baseUrl(tavilyBaseUrl.orElse(null))
+ .includeAnswer(false)
+ .includeRawContent(false)
+ .build();
}
}
diff --git a/integration-tests/langchain4j-web-search/src/test/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/TavilyTestResource.java b/integration-tests/langchain4j-web-search/src/test/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/TavilyTestResource.java
index 7670bb92cd..46f8001cab 100644
--- a/integration-tests/langchain4j-web-search/src/test/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/TavilyTestResource.java
+++ b/integration-tests/langchain4j-web-search/src/test/java/org/apache/camel/quarkus/component/langchain4j/web/search/it/TavilyTestResource.java
@@ -31,10 +31,10 @@ public class TavilyTestResource extends WireMockTestResourceLifecycleManager {
String wiremockUrl = configuration.get("wiremock.url");
if (ObjectHelper.isNotEmpty(wiremockUrl)) {
- configuration.put("quarkus.langchain4j.tavily.base-url", wiremockUrl);
+ configuration.put("langchain4j.tavily.base-url", wiremockUrl);
}
- configuration.put("quarkus.langchain4j.tavily.api-key", envOrDefault(TAVILY_API_KEY, "test-key"));
+ configuration.put("langchain4j.tavily.api-key", envOrDefault(TAVILY_API_KEY, "test-key"));
return configuration;
}
diff --git a/integration-tests/langchain4j-web-search/src/test/resources/mappings/search-16c44e05-4596-4aa8-a50a-319ace00e152.json b/integration-tests/langchain4j-web-search/src/test/resources/mappings/search-16c44e05-4596-4aa8-a50a-319ace00e152.json
deleted file mode 100644
index 9b4b07e179..0000000000
--- a/integration-tests/langchain4j-web-search/src/test/resources/mappings/search-16c44e05-4596-4aa8-a50a-319ace00e152.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "id" : "16c44e05-4596-4aa8-a50a-319ace00e152",
- "name" : "search",
- "request" : {
- "url" : "/search",
- "method" : "POST",
- "bodyPatterns" : [ {
- "equalToJson" : "{\"api_key\":\"test-key\",\"query\":\"In what year was Apache Camel 1.0 released?\",\"search_depth\":\"basic\",\"include_answer\":false,\"include_raw_content\":false,\"max_results\":1,\"include_domains\":[\"[]\"],\"exclude_domains\":[\"[]\"]}",
- "ignoreArrayOrder" : true,
- "ignoreExtraElements" : true
- } ]
- },
- "response" : {
- "status" : 200,
- "body" : "{\"query\":\"In what year was Apache Camel 1.0 released?\",\"follow_up_questions\":null,\"answer\":null,\"images\":[],\"results\":[{\"url\":\"https://callistaenterprise.se/blogg/teknik/2015/10/12/apache-camel-vs-spring-integration/\",\"title\":\"Apache Camel vs Spring Integration - Callista Enterprise AB\",\"content\":\"Apache Camel was released in version 1.0 in 2007. Already from version 1.0, it came with a Java DSL as well as an XML DSL built on top of\",\"score\":0.8458 [...]
- "headers" : {
- "X-Frame-Options" : "DENY",
- "server" : "uvicorn",
- "Strict-Transport-Security" : "max-age=31536000 ; includeSubDomains",
- "content-security-policy" : "default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self';base-uri 'self';form-action 'self'; require-trusted-types-for 'script'; upgrade-insecure-requests;",
- "X-Content-Type-Options" : "nosniff",
- "Date" : "Wed, 18 Jun 2025 06:37:11 GMT",
- "Content-Type" : "application/json"
- }
- },
- "uuid" : "16c44e05-4596-4aa8-a50a-319ace00e152",
- "persistent" : true,
- "insertionIndex" : 1
-}
\ No newline at end of file
diff --git a/integration-tests/langchain4j-web-search/src/test/resources/mappings/search-a2a98ada-9170-4867-9d14-d3811f2c80d4.json b/integration-tests/langchain4j-web-search/src/test/resources/mappings/search-a2a98ada-9170-4867-9d14-d3811f2c80d4.json
new file mode 100644
index 0000000000..88d476a11d
--- /dev/null
+++ b/integration-tests/langchain4j-web-search/src/test/resources/mappings/search-a2a98ada-9170-4867-9d14-d3811f2c80d4.json
@@ -0,0 +1,26 @@
+{
+ "id" : "a2a98ada-9170-4867-9d14-d3811f2c80d4",
+ "name" : "search",
+ "request" : {
+ "url" : "/search",
+ "method" : "POST",
+ "bodyPatterns" : [ {
+ "equalToJson" : "{\n \"api_key\" : \"test-key\",\n \"query\" : \"In what year was Apache Camel 1.0 released?\",\n \"include_answer\" : false,\n \"include_raw_content\" : false,\n \"max_results\" : 1\n}",
+ "ignoreArrayOrder" : true,
+ "ignoreExtraElements" : true
+ } ]
+ },
+ "response" : {
+ "status" : 200,
+ "body" : "{\"query\":\"In what year was Apache Camel 1.0 released?\",\"follow_up_questions\":null,\"answer\":null,\"images\":[],\"results\":[{\"url\":\"https://raymondmeester.medium.com/apache-camel-xml-vs-json-314bb71073e7\",\"title\":\"Apache Camel: XML vs. JSON - Raymond Meester - Medium\",\"content\":\"Apache Camel, released in 2007 , supported most of these standards. But things were about to shift towards JSON. Does Camel support this format today just as well?\",\"score\":0.98 [...]
+ "headers" : {
+ "server" : "uvicorn",
+ "content-security-policy" : "default-src 'none'; script-src 'self'; connect-src 'self'; img-src 'self'; style-src 'self';base-uri 'self';form-action 'self'; require-trusted-types-for 'script'; upgrade-insecure-requests;",
+ "Date" : "Tue, 05 Aug 2025 14:46:08 GMT",
+ "Content-Type" : "application/json"
+ }
+ },
+ "uuid" : "a2a98ada-9170-4867-9d14-d3811f2c80d4",
+ "persistent" : true,
+ "insertionIndex" : 1
+}
\ No newline at end of file
diff --git a/integration-tests/langchain4j/pom.xml b/integration-tests/langchain4j/pom.xml
deleted file mode 100644
index 0aa796b729..0000000000
--- a/integration-tests/langchain4j/pom.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-build-parent-it</artifactId>
- <version>3.27.0-SNAPSHOT</version>
- <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
- </parent>
-
- <artifactId>camel-quarkus-integration-test-langchain4j</artifactId>
- <name>Camel Quarkus :: Integration Tests :: langChain4j</name>
- <description>Integration tests for LangChain4j high level api usage with Camel Quarkus</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgs>
- <arg>-parameters</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-direct</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-jsonpath</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-rest</artifactId>
- </dependency>
-
- <!-- test dependencies -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit5</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.rest-assured</groupId>
- <artifactId>rest-assured</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>virtualDependencies</id>
- <activation>
- <property>
- <name>!noVirtualDependencies</name>
- </property>
- </activation>
- <dependencies>
- <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-direct-deployment</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-jsonpath-deployment</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j-deployment</artifactId>
- <version>${project.version}</version>
- <type>pom</type>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </profile>
- <profile>
- <id>native</id>
- <activation>
- <property>
- <name>native</name>
- </property>
- </activation>
- <properties>
- <quarkus.native.enabled>true</quarkus.native.enabled>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/AiServiceResolvedByInterface.java b/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/AiServiceResolvedByInterface.java
deleted file mode 100644
index 5d6b30f94f..0000000000
--- a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/AiServiceResolvedByInterface.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain.it;
-
-import java.util.function.Supplier;
-
-import dev.langchain4j.data.message.AiMessage;
-import dev.langchain4j.model.chat.ChatModel;
-import dev.langchain4j.model.chat.request.ChatRequest;
-import dev.langchain4j.model.chat.response.ChatResponse;
-import dev.langchain4j.service.UserMessage;
-import io.quarkiverse.langchain4j.RegisterAiService;
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.camel.Handler;
-
-@ApplicationScoped
-@RegisterAiService(chatLanguageModelSupplier = AiServiceResolvedByInterface.AiServiceResolvedByInterfaceModelSupplier.class)
-public interface AiServiceResolvedByInterface {
-
- class AiServiceResolvedByInterfaceModelSupplier implements Supplier<ChatModel> {
- @Override
- public ChatModel get() {
- return new ChatModel() {
- @Override
- public ChatResponse doChat(ChatRequest chatRequest) {
- return ChatResponse.builder()
- .aiMessage(new AiMessage("AiServiceResolvedByInterface has been resolved"))
- .build();
- }
- };
- }
- }
-
- @UserMessage("Any prompt")
- @Handler
- String chat(String input);
-}
diff --git a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/AiServiceResolvedByName.java b/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/AiServiceResolvedByName.java
deleted file mode 100644
index cb5b12cf75..0000000000
--- a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/AiServiceResolvedByName.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain.it;
-
-import java.util.function.Supplier;
-
-import dev.langchain4j.data.message.AiMessage;
-import dev.langchain4j.model.chat.ChatModel;
-import dev.langchain4j.model.chat.request.ChatRequest;
-import dev.langchain4j.model.chat.response.ChatResponse;
-import dev.langchain4j.service.UserMessage;
-import io.quarkiverse.langchain4j.RegisterAiService;
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Named;
-import org.apache.camel.Handler;
-
-@ApplicationScoped
-@Named("aiServiceResolvedByName")
-@RegisterAiService(chatLanguageModelSupplier = AiServiceResolvedByName.AiServiceResolvedByNameModelSupplier.class)
-public interface AiServiceResolvedByName {
-
- class AiServiceResolvedByNameModelSupplier implements Supplier<ChatModel> {
- @Override
- public ChatModel get() {
- return new ChatModel() {
- @Override
- public ChatResponse doChat(ChatRequest chatRequest) {
- return ChatResponse.builder()
- .aiMessage(new AiMessage("AiServiceResolvedByName has been resolved"))
- .build();
- }
- };
- }
- }
-
- @UserMessage("Any prompt")
- @Handler
- String chatByName(String input);
-}
diff --git a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jResource.java b/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jResource.java
deleted file mode 100644
index 16e0d6171a..0000000000
--- a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/LangChain4jResource.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain.it;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.ws.rs.GET;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.MediaType;
-import org.apache.camel.ProducerTemplate;
-
-@Path("/langchain4j")
-@ApplicationScoped
-public class LangChain4jResource {
-
- @Inject
- ProducerTemplate producerTemplate;
-
- @Path("/camel-annotations-should-work-as-expected")
- @POST
- @Produces(MediaType.APPLICATION_JSON)
- public String camelAnnotationsShouldWorkAsExpected(String json) {
- return producerTemplate.requestBody("direct:camel-annotations-should-work-as-expected", json, String.class);
- }
-
- @Path("/ai-service-should-be-resolvable-by-interface")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public String aiServiceShouldBeResolvableByInterface() {
- return producerTemplate.requestBody("direct:ai-service-should-be-resolvable-by-interface", "dummy-body", String.class);
- }
-
- @Path("/ai-service-should-be-resolvable-by-name")
- @GET
- @Produces(MediaType.TEXT_PLAIN)
- public String aiServiceShouldBeResolvableByName() {
- return producerTemplate.requestBody("direct:ai-service-should-be-resolvable-by-name", "dummy-body", String.class);
- }
-
-}
diff --git a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/MirrorAiService.java b/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/MirrorAiService.java
deleted file mode 100644
index 9655b348ee..0000000000
--- a/integration-tests/langchain4j/src/main/java/org/apache/camel/quarkus/component/langchain/it/MirrorAiService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain.it;
-
-import java.util.function.Supplier;
-
-import dev.langchain4j.data.message.AiMessage;
-import dev.langchain4j.model.chat.ChatModel;
-import dev.langchain4j.model.chat.request.ChatRequest;
-import dev.langchain4j.model.chat.response.ChatResponse;
-import dev.langchain4j.service.UserMessage;
-import io.quarkiverse.langchain4j.RegisterAiService;
-import jakarta.enterprise.context.ApplicationScoped;
-import org.apache.camel.Handler;
-import org.apache.camel.Header;
-import org.apache.camel.jsonpath.JsonPath;
-import org.apache.camel.quarkus.component.langchain.it.MirrorAiService.MirrorModelSupplier;
-
-@ApplicationScoped
-@RegisterAiService(chatLanguageModelSupplier = MirrorModelSupplier.class)
-public interface MirrorAiService {
-
- class MirrorModelSupplier implements Supplier<ChatModel> {
- @Override
- public ChatModel get() {
- return new ChatModel() {
- @Override
- public ChatResponse doChat(ChatRequest chatRequest) {
- return ChatResponse.builder()
- .aiMessage(new AiMessage(
- ((dev.langchain4j.data.message.UserMessage) chatRequest.messages().get(0)).singleText()))
- .build();
- }
- };
- }
- }
-
- @UserMessage("{\"fromJsonPath\": \"{fromJsonPath}\", \"fromHeader\": \"{fromHeader}\"}")
- @Handler
- String invoke(@JsonPath("$.included") String fromJsonPath, @Header("headerName") String fromHeader);
-}
diff --git a/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jIT.java b/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jIT.java
deleted file mode 100644
index 5352031b37..0000000000
--- a/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jIT.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain4jit;
-
-import io.quarkus.test.junit.QuarkusIntegrationTest;
-
-@QuarkusIntegrationTest
-class LangChain4jIT extends LangChain4jTest {
-
-}
diff --git a/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java b/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java
deleted file mode 100644
index ddaba2ca9b..0000000000
--- a/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-package org.apache.camel.quarkus.component.langchain4jit;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.Matchers.is;
-
-@QuarkusTest
-class LangChain4jTest {
-
- @Test
- void camelAnnotationsShouldWorkAsExpected() {
- RestAssured.given()
- .body("{\"included\": \"included-content\", \"ignored\": \"ignored-content\"}")
- .post("/langchain4j/camel-annotations-should-work-as-expected")
- .then()
- .statusCode(200)
- .body("fromJsonPath", is("included-content"))
- .body("fromHeader", is("headerValue"));
- }
-
- @Test
- void aiServiceShouldBeResolvedByInterface() {
- RestAssured.given()
- .get("/langchain4j/ai-service-should-be-resolvable-by-interface")
- .then()
- .statusCode(200)
- .body(is("AiServiceResolvedByInterface has been resolved"));
- }
-
- @Test
- void aiServiceShouldBeResolvedByName() {
- RestAssured.given()
- .get("/langchain4j/ai-service-should-be-resolvable-by-name")
- .then()
- .statusCode(200)
- .body(is("AiServiceResolvedByName has been resolved"));
- }
-}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 5ee45fc7c9..184bd89b52 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -148,7 +148,6 @@
<module>knative</module>
<module>kubernetes</module>
<module>kudu</module>
- <module>langchain4j</module>
<module>langchain4j-chat</module>
<module>langchain4j-tokenizer</module>
<module>langchain4j-tools</module>
diff --git a/poms/bom-test/pom.xml b/poms/bom-test/pom.xml
index 1b79df55a2..897cd20d8d 100644
--- a/poms/bom-test/pom.xml
+++ b/poms/bom-test/pom.xml
@@ -64,19 +64,19 @@
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-ollama</artifactId>
- <version>${quarkiverse-langchain4j.version}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-ollama</artifactId>
+ <version>${langchain4j-rc.version}</version>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-openai</artifactId>
- <version>${quarkiverse-langchain4j.version}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-openai</artifactId>
+ <version>${langchain4j-rc.version}</version>
</dependency>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-tavily</artifactId>
- <version>${quarkiverse-langchain4j.version}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-web-search-engine-tavily</artifactId>
+ <version>${langchain4j-beta.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.micrometer.registry</groupId>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index c6e3104d6a..3cd0ec65c2 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -4996,11 +4996,6 @@
<artifactId>camel-quarkus-kudu-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j</artifactId>
- <version>${camel-quarkus.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-agent</artifactId>
@@ -5021,11 +5016,6 @@
<artifactId>camel-quarkus-langchain4j-chat-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j-deployment</artifactId>
- <version>${camel-quarkus.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-embeddings</artifactId>
@@ -7331,16 +7321,6 @@
<artifactId>quarkus-jsch-deployment</artifactId>
<version>${quarkiverse-jsch.version}</version>
</dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core</artifactId>
- <version>${quarkiverse-langchain4j.version}</version>
- </dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core-deployment</artifactId>
- <version>${quarkiverse-langchain4j.version}</version>
- </dependency>
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml b/poms/bom/src/main/generated/flattened-full-pom.xml
index 4b99c1dc2b..1a5572b093 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -4884,11 +4884,6 @@
<artifactId>camel-quarkus-kudu-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>camel-quarkus-langchain4j</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-quarkus-langchain4j-agent</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -4909,11 +4904,6 @@
<artifactId>camel-quarkus-langchain4j-chat-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>camel-quarkus-langchain4j-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-quarkus-langchain4j-embeddings</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -7217,16 +7207,6 @@
<artifactId>quarkus-jsch-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.1.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>quarkus-langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>1.1.3</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>quarkus-langchain4j-core-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>1.1.3</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>quarkus-pooled-jms</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml b/poms/bom/src/main/generated/flattened-reduced-pom.xml
index 9ebf99b4a8..efe9f7925c 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -4874,11 +4874,6 @@
<artifactId>camel-quarkus-kudu-deployment</artifactId>
<version>3.27.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j</artifactId>
- <version>3.27.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-agent</artifactId>
@@ -4899,11 +4894,6 @@
<artifactId>camel-quarkus-langchain4j-chat-deployment</artifactId>
<version>3.27.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-langchain4j-deployment</artifactId>
- <version>3.27.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-langchain4j-embeddings</artifactId>
@@ -7182,16 +7172,6 @@
<artifactId>quarkus-jsch-deployment</artifactId>
<version>3.1.0</version>
</dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core</artifactId>
- <version>1.1.3</version>
- </dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-core-deployment</artifactId>
- <version>1.1.3</version>
- </dependency>
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId>
<artifactId>quarkus-pooled-jms</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
index 1c9a498740..c520839e39 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -4874,11 +4874,6 @@
<artifactId>camel-quarkus-kudu-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>camel-quarkus-langchain4j</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-quarkus-langchain4j-agent</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -4899,11 +4894,6 @@
<artifactId>camel-quarkus-langchain4j-chat-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>camel-quarkus-langchain4j-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>3.27.0-SNAPSHOT</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-quarkus-langchain4j-embeddings</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -7182,16 +7172,6 @@
<artifactId>quarkus-jsch-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.1.0</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>quarkus-langchain4j-core</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>1.1.3</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
- <dependency>
- <groupId>io.quarkiverse.langchain4j</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <artifactId>quarkus-langchain4j-core-deployment</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- <version>1.1.3</version><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
- </dependency>
<dependency>
<groupId>io.quarkiverse.messaginghub</groupId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>quarkus-pooled-jms</artifactId><!-- org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
diff --git a/tooling/internal-dependency-management/pom.xml b/tooling/internal-dependency-management/pom.xml
index 405581b1ad..21bec7ca31 100644
--- a/tooling/internal-dependency-management/pom.xml
+++ b/tooling/internal-dependency-management/pom.xml
@@ -41,6 +41,13 @@
<type>pom</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>io.quarkiverse.langchain4j</groupId>
+ <artifactId>quarkus-langchain4j-bom</artifactId>
+ <version>${quarkiverse-langchain4j.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
index f07ace5bff..ad669296af 100644
--- a/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
+++ b/tooling/maven-plugin/src/main/java/org/apache/camel/quarkus/maven/UpdateExtensionDocPageMojo.java
@@ -202,6 +202,7 @@ public class UpdateExtensionDocPageMojo extends AbstractDocGeneratorMojo {
model.put("hasDurationOption", configOptions.stream().anyMatch(ConfigItem::isTypeDuration));
model.put("hasMemSizeOption", configOptions.stream().anyMatch(ConfigItem::isTypeMemSize));
model.put("configOptions", configOptions);
+ model.put("langchain4jVersion", project.getProperties().get("langchain4j.version"));
model.put("humanReadableKind", new TemplateMethodModelEx() {
@Override
public Object exec(List arguments) throws TemplateModelException {
diff --git a/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc b/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc
index 6554fcde3f..bfa74c789a 100644
--- a/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc
+++ b/tooling/maven-plugin/src/main/resources/doc-templates/extension-doc-page.adoc
@@ -102,17 +102,17 @@ You will also need to enable serialization for the exception classes that you in
[#if activatesQuarkusLangChain4jBom ]
[id="extensions-[=artifactIdBase]-quarkus-langchain4j-bom"]
-== Ensure Quarkus LangChain4j dependencies version alignment with the Bom
+== LangChain4j dependency management
-In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the Quarkus LangChain4j bom as below:
+In order to ensure alignment across all Quarkus and LangChain4j related dependencies, it is recommended to import the LangChain4j BOM as below:
[source,xml]
----
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>io.quarkiverse.langchain4j</groupId>
- <artifactId>quarkus-langchain4j-bom</artifactId>
- <version>${insert your version here}</version>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j-bom</artifactId>
+ <version>[=langchain4jVersion]</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -122,7 +122,7 @@ In order to ensure alignment across all Quarkus and LangChain4j related dependen
----
Note that the import order is paramount when using maven `dependencyManagement`.
-As such, one might need to import the `quarkus-langchain4j-bom` before other related Camel and Quarkus boms.
+As such, one might need to import the `langchain4j-bom` before other related Camel and Quarkus BOMs.
[/#if]
[#if configuration?? || configOptions?size != 0 ]
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index 4f9ca867e1..a01f7451ce 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -44,7 +44,6 @@ group-02:
- jackson-protobuf
- jfr
- kafka-oauth
- - langchain4j
- oaipmh
- pubnub
- protobuf