You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2025/08/08 11:41:07 UTC
(camel) 02/04: CAMEL-22327: separate API from implementation
This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d5dee10439870f540fb70ed860802484a7595e5c
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Aug 6 19:26:29 2025 +0200
CAMEL-22327: separate API from implementation
---
bom/camel-bom/pom.xml | 5 ++
catalog/camel-allcomponents/pom.xml | 5 ++
.../catalog/components/langchain4j-agent.json | 4 +-
.../{ => camel-langchain4j-agent-api}/pom.xml | 51 ++++++-----
.../services/org/apache/camel/other.properties | 7 ++
.../generated/resources/langchain4j-agent-api.json | 13 +++
.../component/langchain4j/agent/api/Agent.java | 0
.../langchain4j/agent/api/AgentConfiguration.java | 0
.../langchain4j/agent/api/AgentWithMemory.java | 1 -
.../langchain4j/agent/api/AgentWithoutMemory.java | 1 -
.../langchain4j/agent/api}/AiAgentBody.java | 0
.../agent/api}/AiAgentWithMemoryService.java | 2 +-
.../agent/api}/AiAgentWithoutMemoryService.java | 2 +-
.../camel-ai/camel-langchain4j-agent/pom.xml | 5 ++
components/camel-ai/pom.xml | 1 +
.../examples/json/langchain4j-agent-api.json | 1 +
.../Langchain4jAgentComponentBuilderFactory.java | 98 +++-------------------
.../LangChain4jAgentEndpointBuilderFactory.java | 15 ++--
parent/pom.xml | 5 ++
19 files changed, 92 insertions(+), 124 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index a1f14e281e2..bae2e243ad3 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1332,6 +1332,11 @@
<artifactId>camel-langchain4j-agent</artifactId>
<version>4.14.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-langchain4j-agent-api</artifactId>
+ <version>4.14.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-chat</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index 10bdab0edac..32890b8166f 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1156,6 +1156,11 @@
<artifactId>camel-langchain4j-agent</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-langchain4j-agent-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-chat</artifactId>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json
index aff58a2245a..528c6f36f70 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-agent.json
@@ -24,7 +24,7 @@
"remote": true
},
"componentProperties": {
- "agent": { "index": 0, "kind": "property", "displayName": "Agent", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.agent.Agent", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "The agent to use for the component" },
+ "agent": { "index": 0, "kind": "property", "displayName": "Agent", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.agent.api.Agent", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "The agent to use for the component" },
"configuration": { "index": 1, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration" },
"lazyStartProducer": { "index": 2, "kind": "property", "displayName": "Lazy Start Producer", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail [...]
"tags": { "index": 3, "kind": "property", "displayName": "Tags", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Tags for discovering and calling Camel route tools" },
@@ -36,7 +36,7 @@
},
"properties": {
"agentId": { "index": 0, "kind": "path", "displayName": "Agent Id", "group": "producer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The Agent id" },
- "agent": { "index": 1, "kind": "parameter", "displayName": "Agent", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.agent.Agent", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "The agent to use for the component" },
+ "agent": { "index": 1, "kind": "parameter", "displayName": "Agent", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.agent.api.Agent", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "The agent to use for the component" },
"tags": { "index": 2, "kind": "parameter", "displayName": "Tags", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration", "configurationField": "configuration", "description": "Tags for discovering and calling Camel route tools" },
"lazyStartProducer": { "index": 3, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a produc [...]
}
diff --git a/components/camel-ai/pom.xml b/components/camel-ai/camel-langchain4j-agent-api/pom.xml
similarity index 55%
copy from components/camel-ai/pom.xml
copy to components/camel-ai/camel-langchain4j-agent-api/pom.xml
index 9293fc8161e..0d4f473eace 100644
--- a/components/camel-ai/pom.xml
+++ b/components/camel-ai/camel-langchain4j-agent-api/pom.xml
@@ -23,34 +23,31 @@
<modelVersion>4.0.0</modelVersion>
<parent>
+ <artifactId>camel-ai-parent</artifactId>
<groupId>org.apache.camel</groupId>
- <artifactId>components</artifactId>
<version>4.14.0-SNAPSHOT</version>
</parent>
- <artifactId>camel-ai-parent</artifactId>
- <packaging>pom</packaging>
- <name>Camel :: AI :: Parent</name>
- <description>Camel AI parent</description>
-
- <modules>
- <module>camel-chatscript</module>
- <module>camel-djl</module>
- <module>camel-kserve</module>
- <module>camel-langchain4j-agent</module>
- <module>camel-langchain4j-chat</module>
- <module>camel-langchain4j-core</module>
- <module>camel-langchain4j-embeddings</module>
- <module>camel-langchain4j-tokenizer</module>
- <module>camel-langchain4j-tools</module>
- <module>camel-langchain4j-web-search</module>
- <module>camel-milvus</module>
- <module>camel-neo4j</module>
- <module>camel-pinecone</module>
- <module>camel-qdrant</module>
- <module>camel-tensorflow-serving</module>
- <module>camel-torchserve</module>
- <module>camel-weaviate</module>
- </modules>
-
-</project>
+ <artifactId>camel-langchain4j-agent-api</artifactId>
+
+ <packaging>jar</packaging>
+ <name>Camel :: AI :: LangChain4j :: Agent :: API</name>
+ <description>LangChain4j Agent API</description>
+
+ <properties>
+ <supportLevel>Preview</supportLevel>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>dev.langchain4j</groupId>
+ <artifactId>langchain4j</artifactId>
+ <version>${langchain4j-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
\ No newline at end of file
diff --git a/components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/META-INF/services/org/apache/camel/other.properties
new file mode 100644
index 00000000000..cc8a58d1120
--- /dev/null
+++ b/components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/META-INF/services/org/apache/camel/other.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+name=langchain4j-agent-api
+groupId=org.apache.camel
+artifactId=camel-langchain4j-agent-api
+version=4.14.0-SNAPSHOT
+projectName=Camel :: AI :: LangChain4j :: Agent :: API
+projectDescription=LangChain4j Agent API
diff --git a/components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/langchain4j-agent-api.json b/components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/langchain4j-agent-api.json
new file mode 100644
index 00000000000..faee18d1147
--- /dev/null
+++ b/components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/langchain4j-agent-api.json
@@ -0,0 +1,13 @@
+{
+ "other": {
+ "kind": "other",
+ "name": "langchain4j-agent-api",
+ "title": "Langchain4j Agent Api",
+ "description": "LangChain4j Agent API",
+ "deprecated": false,
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-langchain4j-agent-api",
+ "version": "4.14.0-SNAPSHOT"
+ }
+}
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/Agent.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/Agent.java
similarity index 100%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/Agent.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/Agent.java
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentConfiguration.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentConfiguration.java
similarity index 100%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentConfiguration.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentConfiguration.java
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithMemory.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithMemory.java
similarity index 97%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithMemory.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithMemory.java
index bf592b984b7..471b03abede 100644
--- a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithMemory.java
+++ b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithMemory.java
@@ -21,7 +21,6 @@ import java.util.List;
import dev.langchain4j.service.AiServices;
import dev.langchain4j.service.tool.ToolProvider;
import org.apache.camel.component.langchain4j.agent.AiAgentBody;
-import org.apache.camel.component.langchain4j.agent.AiAgentWithMemoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithoutMemory.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithoutMemory.java
similarity index 97%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithoutMemory.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithoutMemory.java
index c8700e31a38..1623fb5d037 100644
--- a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithoutMemory.java
+++ b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AgentWithoutMemory.java
@@ -21,7 +21,6 @@ import java.util.List;
import dev.langchain4j.service.AiServices;
import dev.langchain4j.service.tool.ToolProvider;
import org.apache.camel.component.langchain4j.agent.AiAgentBody;
-import org.apache.camel.component.langchain4j.agent.AiAgentWithoutMemoryService;
/**
* Implementation of Agent for AI agents without memory support. This agent handles chat interactions without
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentBody.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentBody.java
similarity index 100%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentBody.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentBody.java
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentWithMemoryService.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentWithMemoryService.java
similarity index 96%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentWithMemoryService.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentWithMemoryService.java
index 49ac5c7567e..8f7d292690e 100644
--- a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentWithMemoryService.java
+++ b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentWithMemoryService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.langchain4j.agent;
+package org.apache.camel.component.langchain4j.agent.api;
import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
diff --git a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentWithoutMemoryService.java b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentWithoutMemoryService.java
similarity index 96%
rename from components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentWithoutMemoryService.java
rename to components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentWithoutMemoryService.java
index 69dd3142a83..961a73e0437 100644
--- a/components/camel-ai/camel-langchain4j-agent/src/main/java/org/apache/camel/component/langchain4j/agent/AiAgentWithoutMemoryService.java
+++ b/components/camel-ai/camel-langchain4j-agent-api/src/main/java/org/apache/camel/component/langchain4j/agent/api/AiAgentWithoutMemoryService.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.camel.component.langchain4j.agent;
+package org.apache.camel.component.langchain4j.agent.api;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
diff --git a/components/camel-ai/camel-langchain4j-agent/pom.xml b/components/camel-ai/camel-langchain4j-agent/pom.xml
index e9b4ccccd89..36d0cb3a26b 100644
--- a/components/camel-ai/camel-langchain4j-agent/pom.xml
+++ b/components/camel-ai/camel-langchain4j-agent/pom.xml
@@ -44,6 +44,11 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-support</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-langchain4j-agent-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
diff --git a/components/camel-ai/pom.xml b/components/camel-ai/pom.xml
index 9293fc8161e..c2bae8edf78 100644
--- a/components/camel-ai/pom.xml
+++ b/components/camel-ai/pom.xml
@@ -37,6 +37,7 @@
<module>camel-chatscript</module>
<module>camel-djl</module>
<module>camel-kserve</module>
+ <module>camel-langchain4j-agent-api</module>
<module>camel-langchain4j-agent</module>
<module>camel-langchain4j-chat</module>
<module>camel-langchain4j-core</module>
diff --git a/docs/components/modules/others/examples/json/langchain4j-agent-api.json b/docs/components/modules/others/examples/json/langchain4j-agent-api.json
new file mode 120000
index 00000000000..6602ab96f4d
--- /dev/null
+++ b/docs/components/modules/others/examples/json/langchain4j-agent-api.json
@@ -0,0 +1 @@
+../../../../../../components/camel-ai/camel-langchain4j-agent-api/src/generated/resources/langchain4j-agent-api.json
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java
index 2ad1ee51ff4..bcf7fce82a3 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/Langchain4jAgentComponentBuilderFactory.java
@@ -51,34 +51,34 @@ public interface Langchain4jAgentComponentBuilderFactory {
interface Langchain4jAgentComponentBuilder extends ComponentBuilder<LangChain4jAgentComponent> {
/**
- * The configuration.
+ * The agent to use for the component.
*
* The option is a:
- * <code>org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration</code> type.
+ * <code>org.apache.camel.component.langchain4j.agent.api.Agent</code> type.
*
* Group: producer
*
- * @param configuration the value to set
+ * @param agent the value to set
* @return the dsl builder
*/
- default Langchain4jAgentComponentBuilder configuration(org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration configuration) {
- doSetProperty("configuration", configuration);
+ default Langchain4jAgentComponentBuilder agent(org.apache.camel.component.langchain4j.agent.api.Agent agent) {
+ doSetProperty("agent", agent);
return this;
}
/**
- * Comma-separated list of input guardrail class names to validate user
- * input before sending to LLM.
+ * The configuration.
*
- * The option is a: <code>java.lang.String</code> type.
+ * The option is a:
+ * <code>org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration</code> type.
*
* Group: producer
*
- * @param inputGuardrails the value to set
+ * @param configuration the value to set
* @return the dsl builder
*/
- default Langchain4jAgentComponentBuilder inputGuardrails(java.lang.String inputGuardrails) {
- doSetProperty("inputGuardrails", inputGuardrails);
+ default Langchain4jAgentComponentBuilder configuration(org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration configuration) {
+ doSetProperty("configuration", configuration);
return this;
}
@@ -107,22 +107,6 @@ public interface Langchain4jAgentComponentBuilderFactory {
return this;
}
- /**
- * Comma-separated list of output guardrail class names to validate LLM
- * responses.
- *
- * The option is a: <code>java.lang.String</code> type.
- *
- * Group: producer
- *
- * @param outputGuardrails the value to set
- * @return the dsl builder
- */
- default Langchain4jAgentComponentBuilder outputGuardrails(java.lang.String outputGuardrails) {
- doSetProperty("outputGuardrails", outputGuardrails);
- return this;
- }
-
/**
* Tags for discovering and calling Camel route tools.
*
@@ -159,60 +143,6 @@ public interface Langchain4jAgentComponentBuilderFactory {
doSetProperty("autowiredEnabled", autowiredEnabled);
return this;
}
-
- /**
- * Chat Memory Provider of type
- * dev.langchain4j.memory.ChatMemoryProvider. Note for this to be
- * successful, you need to use a reliable ChatMemoryStore. This provider
- * supposes that a user has multiple sessions, if need only a single
- * session, use a default memoryId.
- *
- * The option is a:
- * <code>dev.langchain4j.memory.chat.ChatMemoryProvider</code> type.
- *
- * Group: advanced
- *
- * @param chatMemoryProvider the value to set
- * @return the dsl builder
- */
- default Langchain4jAgentComponentBuilder chatMemoryProvider(dev.langchain4j.memory.chat.ChatMemoryProvider chatMemoryProvider) {
- doSetProperty("chatMemoryProvider", chatMemoryProvider);
- return this;
- }
-
- /**
- * Chat Model of type dev.langchain4j.model.chat.ChatModel.
- *
- * The option is a:
- * <code>dev.langchain4j.model.chat.ChatModel</code> type.
- *
- * Group: advanced
- *
- * @param chatModel the value to set
- * @return the dsl builder
- */
- default Langchain4jAgentComponentBuilder chatModel(dev.langchain4j.model.chat.ChatModel chatModel) {
- doSetProperty("chatModel", chatModel);
- return this;
- }
-
- /**
- * Retrieval Augmentor for advanced RAG of type
- * dev.langchain4j.rag.RetrievalAugmentor. This allows using RAG on both
- * Naive and Advanced RAG.
- *
- * The option is a:
- * <code>dev.langchain4j.rag.RetrievalAugmentor</code> type.
- *
- * Group: advanced
- *
- * @param retrievalAugmentor the value to set
- * @return the dsl builder
- */
- default Langchain4jAgentComponentBuilder retrievalAugmentor(dev.langchain4j.rag.RetrievalAugmentor retrievalAugmentor) {
- doSetProperty("retrievalAugmentor", retrievalAugmentor);
- return this;
- }
}
class Langchain4jAgentComponentBuilderImpl
@@ -234,15 +164,11 @@ public interface Langchain4jAgentComponentBuilderFactory {
String name,
Object value) {
switch (name) {
+ case "agent": getOrCreateConfiguration((LangChain4jAgentComponent) component).setAgent((org.apache.camel.component.langchain4j.agent.api.Agent) value); return true;
case "configuration": ((LangChain4jAgentComponent) component).setConfiguration((org.apache.camel.component.langchain4j.agent.LangChain4jAgentConfiguration) value); return true;
- case "inputGuardrails": getOrCreateConfiguration((LangChain4jAgentComponent) component).setInputGuardrails((java.lang.String) value); return true;
case "lazyStartProducer": ((LangChain4jAgentComponent) component).setLazyStartProducer((boolean) value); return true;
- case "outputGuardrails": getOrCreateConfiguration((LangChain4jAgentComponent) component).setOutputGuardrails((java.lang.String) value); return true;
case "tags": getOrCreateConfiguration((LangChain4jAgentComponent) component).setTags((java.lang.String) value); return true;
case "autowiredEnabled": ((LangChain4jAgentComponent) component).setAutowiredEnabled((boolean) value); return true;
- case "chatMemoryProvider": getOrCreateConfiguration((LangChain4jAgentComponent) component).setChatMemoryProvider((dev.langchain4j.memory.chat.ChatMemoryProvider) value); return true;
- case "chatModel": getOrCreateConfiguration((LangChain4jAgentComponent) component).setChatModel((dev.langchain4j.model.chat.ChatModel) value); return true;
- case "retrievalAugmentor": getOrCreateConfiguration((LangChain4jAgentComponent) component).setRetrievalAugmentor((dev.langchain4j.rag.RetrievalAugmentor) value); return true;
default: return false;
}
}
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java
index 5e86361ca3e..098b7e805a0 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jAgentEndpointBuilderFactory.java
@@ -17,11 +17,14 @@
*/
package org.apache.camel.builder.endpoint.dsl;
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.function.*;
+import java.util.stream.*;
import javax.annotation.processing.Generated;
-
+import org.apache.camel.builder.EndpointConsumerBuilder;
import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
-import org.apache.camel.component.langchain4j.agent.api.Agent;
/**
* LangChain4j Agent component
@@ -45,14 +48,15 @@ public interface LangChain4jAgentEndpointBuilderFactory {
* The agent to use for the component.
*
* The option is a:
- * <code>org.apache.camel.component.langchain4j.agent.api.Agent</code> type.
+ * <code>org.apache.camel.component.langchain4j.agent.api.Agent</code>
+ * type.
*
* Group: producer
*
* @param agent the value to set
* @return the dsl builder
*/
- default LangChain4jAgentEndpointBuilder agent(Agent agent) {
+ default LangChain4jAgentEndpointBuilder agent(org.apache.camel.component.langchain4j.agent.api.Agent agent) {
doSetProperty("agent", agent);
return this;
}
@@ -60,7 +64,8 @@ public interface LangChain4jAgentEndpointBuilderFactory {
* The agent to use for the component.
*
* The option will be converted to a
- * <code>org.apache.camel.component.langchain4j.agent.api.Agent</code> type.
+ * <code>org.apache.camel.component.langchain4j.agent.api.Agent</code>
+ * type.
*
* Group: producer
*
diff --git a/parent/pom.xml b/parent/pom.xml
index 242d5a19c13..579d75cbe97 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -1806,6 +1806,11 @@
<artifactId>camel-langchain4j-agent</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-langchain4j-agent-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-langchain4j-chat</artifactId>