jiriOndrusek-agent commented on code in PR #9340:
URL: https://github.com/apache/camel-quarkus/pull/9340#discussion_r4387710927
##########
extensions/langchain4j-ingest/deployment/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/deployment/Langchain4jIngestProcessor.java:
##########
@@ -310,6 +310,36 @@ void validatePipelines(IngestBuildTimeConfig config,
BuildProducer<ValidationErr
"Ingestion pipeline '" + entry.getKey() + "':
max-document-size must not be negative, 0 "
+ "meaning no limit (got " +
pipeline.maxDocumentSize() + ")")));
}
+
+ // the component and IngestRoutes check these at startup; a
configured pipeline fails the build instead
+ boolean media = "media".equalsIgnoreCase(pipeline.modality());
Review Comment:
Yes, done in 92c3c12003. They are skipped for media, as the component does.
Test: `IngestMediaSplitterSettingsTest` (overlap 600 and batch size 0 on a
media pipeline, which builds and starts).
_Generated with [Claude Code](https://claude.com/claude-code) on behalf of
@JiriOndrusek_
##########
extensions/langchain4j-ingest/runtime/src/main/java/org/apache/camel/quarkus/component/langchain4j/ingest/IngestRoutes.java:
##########
@@ -241,17 +262,29 @@ private void compositionRoute(String name, String uri,
sink.put("maxSegmentSize", String.valueOf(maxSegmentSize));
sink.put("maxOverlapSize", String.valueOf(maxOverlapSize));
sink.put("embeddingBatchSize", String.valueOf(embeddingBatchSize));
- sink.put("modality", "text");
- sink.put("contentType", "");
+ // lower-cased, as the Kamelet declares it, rather than relying on a
case-insensitive enum conversion
+ sink.put("modality", modality.toLowerCase(Locale.ROOT));
+ sink.put("contentType", contentType == null ? "" : contentType);
// 0, no limit, is the endpoint's default too
sink.put("maxDocumentSize", String.valueOf(maxDocumentSize));
sink.put("minDocumentSize", "0");
if (documentSplitterName != null) {
sink.put("documentSplitter", "#bean:" + documentSplitterName);
}
- sink.put("includeId", "");
- sink.put("excludeId", "");
- sink.put("documentFilter", "#bean:" + bindInstance(name,
"document-filter", PredicateBuilder.constant(true)));
+ // filter.* comes from configuration for both declaration styles - a
builder pipeline's view
+ // delegates to it, the builder having no filter API - and the
component enforces it
+ IngestRunTimeConfig.PipelineRunTimeConfig.FilterRunTimeConfig filter =
runtime == null
+ ? IngestPipeline.NO_FILTER
+ : runtime.filter();
+ String includeId = filter.includeId().orElse("");
+ String excludeId = filter.excludeId().orElse("");
+ sink.put("includeId", includeId);
+ sink.put("excludeId", excludeId);
+ if (filter.minDocumentSize() != 0) {
Review Comment:
Done in 92c3c12003.
_Generated with [Claude Code](https://claude.com/claude-code) on behalf of
@JiriOndrusek_
--
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]