JiriOndrusek commented on code in PR #9018:
URL: https://github.com/apache/camel-quarkus/pull/9018#discussion_r3805334680


##########
extensions/langchain4j-ingest/runtime/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/core/IngestService.java:
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.langchain4j.ingest.core;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import dev.langchain4j.data.document.Document;
+import dev.langchain4j.data.document.DocumentSplitter;
+import dev.langchain4j.data.document.Metadata;
+import dev.langchain4j.data.document.splitter.DocumentSplitters;
+import dev.langchain4j.data.segment.TextSegment;
+import dev.langchain4j.model.embedding.EmbeddingModel;
+import dev.langchain4j.store.embedding.EmbeddingStore;
+import org.jboss.logging.Logger;
+
+/**
+ * Splits a document, embeds the segments and writes them to the store.
+ *
+ * <p>
+ * Deliberately naive: it writes whatever it is given and remembers nothing, 
so ingesting a
+ * document twice leaves two copies. Keeping a store in step with a changing 
source — skipping
+ * unchanged documents, replacing changed ones, removing deleted ones — needs 
a record of what was
+ * written, and that engine replaces this class.
+ */
+public class IngestService {
+
+    private static final Logger LOG = Logger.getLogger(IngestService.class);
+
+    public static final String METADATA_PIPELINE = "camel_quarkus_pipeline";

Review Comment:
   Done — the search endpoint returns (text, pipeline, documentId) and all five 
pipelines assert the metadata, pinning the CamelAwsS3Key/CamelKafkaKey 
resolution.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to