This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 6a1eae8864e5 Camel-Qdrant: collect processors to be used as ref beans
(#21705)
6a1eae8864e5 is described below
commit 6a1eae8864e5ace24aad25d32dc5b8a94814a51a
Author: Salvatore Mongiardo <[email protected]>
AuthorDate: Fri Mar 6 09:11:52 2026 +0100
Camel-Qdrant: collect processors to be used as ref beans (#21705)
---
.../apache/camel/catalog/components/qdrant.json | 3 +-
.../org/apache/camel/component/qdrant/qdrant.json | 3 +-
.../camel/component/qdrant/QdrantHeaders.java | 3 +
.../camel/component/qdrant/QdrantProducer.java | 5 +-
.../component/qdrant/rag/RAGCreateCollection.java | 60 +++++++++++++++++++
.../component/qdrant/rag/RAGResultExtractor.java | 53 +++++++++++++++++
.../camel/component/qdrant/rag/RAGUpsert.java | 69 ++++++++++++++++++++++
.../component/qdrant/it/QdrantComponentIT.java | 24 ++++++--
.../qdrant/it/QdrantDeleteCollectionIT.java | 24 ++++++--
.../component/qdrant/it/QdrantDeletePointsIT.java | 26 +++++---
.../endpoint/dsl/QdrantEndpointBuilderFactory.java | 12 ++++
11 files changed, 260 insertions(+), 22 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/qdrant.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/qdrant.json
index 9e3043cdc25c..7cb13cf84d63 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/qdrant.json
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/qdrant.json
@@ -45,7 +45,8 @@
"CamelQdrantWithPayload": { "index": 6, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "boolean",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "defaultValue": "true", "description": "Include Payload.",
"constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#INCLUDE_PAYLOAD" },
"CamelQdrantWithVectors": { "index": 7, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "boolean",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "defaultValue": "false", "description": "Include Vectors.",
"constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#INCLUDE_VECTORS" },
"CamelQdrantSize": { "index": 8, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The number of elements.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#SIZE" },
- "CamelQdrantPointId": { "index": 9, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The point id to use for operation.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#POINT_ID" }
+ "CamelQdrantPointId": { "index": 9, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The point id to use for operation.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#POINT_ID" },
+ "CamelQdrantMaxResults": { "index": 10, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The maximum number of results to return from a
similarity search.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#MAX_RESULTS" }
},
"properties": {
"collection": { "index": 0, "kind": "path", "displayName": "Collection",
"group": "producer", "label": "", "required": true, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "The collection Name" },
diff --git
a/components/camel-ai/camel-qdrant/src/generated/resources/META-INF/org/apache/camel/component/qdrant/qdrant.json
b/components/camel-ai/camel-qdrant/src/generated/resources/META-INF/org/apache/camel/component/qdrant/qdrant.json
index 9e3043cdc25c..7cb13cf84d63 100644
---
a/components/camel-ai/camel-qdrant/src/generated/resources/META-INF/org/apache/camel/component/qdrant/qdrant.json
+++
b/components/camel-ai/camel-qdrant/src/generated/resources/META-INF/org/apache/camel/component/qdrant/qdrant.json
@@ -45,7 +45,8 @@
"CamelQdrantWithPayload": { "index": 6, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "boolean",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "defaultValue": "true", "description": "Include Payload.",
"constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#INCLUDE_PAYLOAD" },
"CamelQdrantWithVectors": { "index": 7, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "boolean",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "defaultValue": "false", "description": "Include Vectors.",
"constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#INCLUDE_VECTORS" },
"CamelQdrantSize": { "index": 8, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The number of elements.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#SIZE" },
- "CamelQdrantPointId": { "index": 9, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The point id to use for operation.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#POINT_ID" }
+ "CamelQdrantPointId": { "index": 9, "kind": "header", "displayName": "",
"group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The point id to use for operation.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#POINT_ID" },
+ "CamelQdrantMaxResults": { "index": 10, "kind": "header", "displayName":
"", "group": "producer", "label": "", "required": false, "javaType": "int",
"deprecated": false, "deprecationNote": "", "autowired": false, "secret":
false, "description": "The maximum number of results to return from a
similarity search.", "constantName":
"org.apache.camel.component.qdrant.QdrantHeaders#MAX_RESULTS" }
},
"properties": {
"collection": { "index": 0, "kind": "path", "displayName": "Collection",
"group": "producer", "label": "", "required": true, "type": "string",
"javaType": "java.lang.String", "deprecated": false, "deprecationNote": "",
"autowired": false, "secret": false, "description": "The collection Name" },
diff --git
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantHeaders.java
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantHeaders.java
index ab2435ca28a5..dc526dd17eaf 100644
---
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantHeaders.java
+++
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantHeaders.java
@@ -55,4 +55,7 @@ public final class QdrantHeaders {
@Metadata(description = "The point id to use for operation.", javaType =
"int")
public static final String POINT_ID = "CamelQdrantPointId";
+
+ @Metadata(description = "The maximum number of results to return from a
similarity search.", javaType = "int")
+ public static final String MAX_RESULTS = "CamelQdrantMaxResults";
}
diff --git
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantProducer.java
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantProducer.java
index 975bb4d83782..f3520ed50108 100644
---
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantProducer.java
+++
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/QdrantProducer.java
@@ -273,7 +273,10 @@ public class QdrantProducer extends DefaultAsyncProducer {
}
ObjectHelper.notNull(vectors, "vectors");
- final int maxResults =
getEndpoint().getConfiguration().getMaxResults();
+ final int maxResults = in.getHeader(
+ QdrantHeaders.MAX_RESULTS,
+ getEndpoint().getConfiguration().getMaxResults(),
+ int.class);
final Common.Filter filter =
getEndpoint().getConfiguration().getFilter();
final Duration timeout = getEndpoint().getConfiguration().getTimeout();
diff --git
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.java
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.java
new file mode 100644
index 000000000000..c794273112d0
--- /dev/null
+++
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGCreateCollection.java
@@ -0,0 +1,60 @@
+/*
+ * 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.component.qdrant.rag;
+
+import io.qdrant.client.grpc.Collections;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.qdrant.QdrantAction;
+import org.apache.camel.component.qdrant.QdrantHeaders;
+
+public class RAGCreateCollection implements Processor {
+
+ private String size = "768";
+ private String distance = "Cosine";
+
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ int vectorSize = Integer.parseInt(size);
+
+ Collections.Distance distanceEnum =
Collections.Distance.valueOf(distance);
+
+ Collections.VectorParams vectorParams =
Collections.VectorParams.newBuilder()
+ .setSize(vectorSize)
+ .setDistance(distanceEnum)
+ .build();
+
+ exchange.getIn().setHeader(QdrantHeaders.ACTION,
QdrantAction.CREATE_COLLECTION);
+ exchange.getIn().setBody(vectorParams);
+ }
+
+ public String getSize() {
+ return size;
+ }
+
+ public void setSize(String size) {
+ this.size = size;
+ }
+
+ public String getDistance() {
+ return distance;
+ }
+
+ public void setDistance(String distance) {
+ this.distance = distance;
+ }
+}
diff --git
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGResultExtractor.java
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGResultExtractor.java
new file mode 100644
index 000000000000..87811ec5a16c
--- /dev/null
+++
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGResultExtractor.java
@@ -0,0 +1,53 @@
+/*
+ * 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.component.qdrant.rag;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import io.qdrant.client.grpc.Points;
+import org.apache.camel.Exchange;
+
+public class RAGResultExtractor {
+
+ private String payloadKey = "content";
+
+ @SuppressWarnings("unchecked")
+ public List<Map<String, Object>> extract(Exchange exchange) {
+ List<Points.ScoredPoint> results =
exchange.getIn().getBody(List.class);
+ List<Map<String, Object>> extracted = new ArrayList<>();
+ int rank = 1;
+ for (Points.ScoredPoint point : results) {
+ Map<String, Object> item = new LinkedHashMap<>();
+ item.put("rank", rank++);
+ item.put("content",
point.getPayloadMap().get(payloadKey).getStringValue());
+ item.put("score", point.getScore());
+ extracted.add(item);
+ }
+ return extracted;
+ }
+
+ public String getPayloadKey() {
+ return payloadKey;
+ }
+
+ public void setPayloadKey(String payloadKey) {
+ this.payloadKey = payloadKey;
+ }
+}
diff --git
a/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGUpsert.java
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGUpsert.java
new file mode 100644
index 000000000000..6b9cbb346170
--- /dev/null
+++
b/components/camel-ai/camel-qdrant/src/main/java/org/apache/camel/component/qdrant/rag/RAGUpsert.java
@@ -0,0 +1,69 @@
+/*
+ * 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.component.qdrant.rag;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import io.qdrant.client.PointIdFactory;
+import io.qdrant.client.ValueFactory;
+import io.qdrant.client.VectorsFactory;
+import io.qdrant.client.grpc.Points;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.component.qdrant.QdrantAction;
+import org.apache.camel.component.qdrant.QdrantHeaders;
+
+public class RAGUpsert implements Processor {
+
+ private String payloadKey = "content";
+ private String textVariable = "text";
+ private final AtomicLong pointIdCounter = new AtomicLong(1);
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void process(Exchange exchange) throws Exception {
+ List<Float> embedding = exchange.getIn().getBody(List.class);
+ String text = exchange.getVariable(textVariable, String.class);
+
+ Points.PointStruct point = Points.PointStruct.newBuilder()
+ .setId(PointIdFactory.id(pointIdCounter.getAndIncrement()))
+ .setVectors(VectorsFactory.vectors(embedding))
+ .putAllPayload(Map.of(payloadKey, ValueFactory.value(text)))
+ .build();
+
+ exchange.getIn().setBody(List.of(point));
+ exchange.getIn().setHeader(QdrantHeaders.ACTION, QdrantAction.UPSERT);
+ }
+
+ public String getPayloadKey() {
+ return payloadKey;
+ }
+
+ public void setPayloadKey(String payloadKey) {
+ this.payloadKey = payloadKey;
+ }
+
+ public String getTextVariable() {
+ return textVariable;
+ }
+
+ public void setTextVariable(String textVariable) {
+ this.textVariable = textVariable;
+ }
+}
diff --git
a/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantComponentIT.java
b/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantComponentIT.java
index f99b1161c677..952ad43ee294 100644
---
a/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantComponentIT.java
+++
b/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantComponentIT.java
@@ -29,10 +29,12 @@ import io.qdrant.client.VectorsFactory;
import io.qdrant.client.grpc.Collections;
import io.qdrant.client.grpc.Points;
import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.qdrant.QdrantAction;
import org.apache.camel.component.qdrant.QdrantActionException;
import org.apache.camel.component.qdrant.QdrantHeaders;
import org.apache.camel.component.qdrant.QdrantTestSupport;
+import org.apache.camel.component.qdrant.rag.RAGCreateCollection;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
@@ -45,6 +47,21 @@ import static org.assertj.core.api.Assertions.assertThat;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class QdrantComponentIT extends QdrantTestSupport {
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ RAGCreateCollection createCollectionProcessor = new
RAGCreateCollection();
+ createCollectionProcessor.setSize("2");
+
+ from("direct:createCollection")
+ .process(createCollectionProcessor)
+ .to("qdrant:testComponent");
+ }
+ };
+ }
+
@Test
@Order(0)
void collectionInfoNonExistent() {
@@ -69,12 +86,7 @@ class QdrantComponentIT extends QdrantTestSupport {
@Test
@Order(1)
void createCollection() {
- Exchange result = fluentTemplate.to("qdrant:testComponent")
- .withHeader(QdrantHeaders.ACTION,
QdrantAction.CREATE_COLLECTION)
- .withBody(
- Collections.VectorParams.newBuilder()
- .setSize(2)
-
.setDistance(Collections.Distance.Cosine).build())
+ Exchange result = fluentTemplate.to("direct:createCollection")
.request(Exchange.class);
assertThat(result).isNotNull();
diff --git
a/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeleteCollectionIT.java
b/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeleteCollectionIT.java
index 9a80dba023b9..4369527b2662 100644
---
a/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeleteCollectionIT.java
+++
b/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeleteCollectionIT.java
@@ -21,11 +21,13 @@ import io.grpc.StatusRuntimeException;
import io.qdrant.client.grpc.Collections;
import org.apache.camel.EndpointInject;
import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.qdrant.QdrantAction;
import org.apache.camel.component.qdrant.QdrantActionException;
import org.apache.camel.component.qdrant.QdrantEndpoint;
import org.apache.camel.component.qdrant.QdrantHeaders;
import org.apache.camel.component.qdrant.QdrantTestSupport;
+import org.apache.camel.component.qdrant.rag.RAGCreateCollection;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
@@ -38,15 +40,25 @@ class QdrantDeleteCollectionIT extends QdrantTestSupport {
@EndpointInject("qdrant:collectionForDeletion")
QdrantEndpoint qdrantEndpoint;
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ RAGCreateCollection createCollectionProcessor = new
RAGCreateCollection();
+ createCollectionProcessor.setSize("2");
+
+ from("direct:createCollection")
+ .process(createCollectionProcessor)
+ .to("qdrant:collectionForDeletion");
+ }
+ };
+ }
+
@Test
@Order(1)
void createCollection() {
- Exchange result = fluentTemplate.to(qdrantEndpoint)
- .withHeader(QdrantHeaders.ACTION,
QdrantAction.CREATE_COLLECTION)
- .withBody(
- Collections.VectorParams.newBuilder()
- .setSize(2)
-
.setDistance(Collections.Distance.Cosine).build())
+ Exchange result = fluentTemplate.to("direct:createCollection")
.request(Exchange.class);
assertThat(result).isNotNull();
diff --git
a/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeletePointsIT.java
b/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeletePointsIT.java
index 8e31f722a244..88618a61566f 100644
---
a/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeletePointsIT.java
+++
b/components/camel-ai/camel-qdrant/src/test/java/org/apache/camel/component/qdrant/it/QdrantDeletePointsIT.java
@@ -24,13 +24,14 @@ import io.qdrant.client.ConditionFactory;
import io.qdrant.client.PointIdFactory;
import io.qdrant.client.ValueFactory;
import io.qdrant.client.VectorsFactory;
-import io.qdrant.client.grpc.Collections;
import io.qdrant.client.grpc.Common;
import io.qdrant.client.grpc.Points;
import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.qdrant.QdrantAction;
import org.apache.camel.component.qdrant.QdrantHeaders;
import org.apache.camel.component.qdrant.QdrantTestSupport;
+import org.apache.camel.component.qdrant.rag.RAGCreateCollection;
import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
@@ -40,15 +41,26 @@ import static org.assertj.core.api.Assertions.assertThat;
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class QdrantDeletePointsIT extends QdrantTestSupport {
+
+ @Override
+ protected RouteBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ RAGCreateCollection createCollectionProcessor = new
RAGCreateCollection();
+ createCollectionProcessor.setSize("2");
+
+ from("direct:createCollection")
+ .process(createCollectionProcessor)
+ .to("qdrant:testDelete");
+ }
+ };
+ }
+
@Test
@Order(1)
void createCollection() {
- Exchange result = fluentTemplate.to("qdrant:testDelete")
- .withHeader(QdrantHeaders.ACTION,
QdrantAction.CREATE_COLLECTION)
- .withBody(
- Collections.VectorParams.newBuilder()
- .setSize(2)
-
.setDistance(Collections.Distance.Cosine).build())
+ Exchange result = fluentTemplate.to("direct:createCollection")
.request(Exchange.class);
assertThat(result).isNotNull();
diff --git
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QdrantEndpointBuilderFactory.java
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QdrantEndpointBuilderFactory.java
index 8a66f47164e2..132fb032a2a7 100644
---
a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QdrantEndpointBuilderFactory.java
+++
b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/QdrantEndpointBuilderFactory.java
@@ -474,6 +474,18 @@ public interface QdrantEndpointBuilderFactory {
public String qdrantPointId() {
return "CamelQdrantPointId";
}
+ /**
+ * The maximum number of results to return from a similarity search.
+ *
+ * The option is a: {@code int} type.
+ *
+ * Group: producer
+ *
+ * @return the name of the header {@code QdrantMaxResults}.
+ */
+ public String qdrantMaxResults() {
+ return "CamelQdrantMaxResults";
+ }
}
static QdrantEndpointBuilder endpointBuilder(String componentName, String
path) {
class QdrantEndpointBuilderImpl extends AbstractEndpointBuilder
implements QdrantEndpointBuilder, AdvancedQdrantEndpointBuilder {