davsclaus commented on code in PR #30452:
URL: https://github.com/apache/camel/pull/30452#discussion_r4639270895


##########
components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/transform/PineconeEmbeddingsDataTypeTransformer.java:
##########
@@ -63,9 +63,14 @@ public void transform(Message message, DataType fromType, 
DataType toType) {
         }
         TextSegment text = message.getBody(TextSegment.class);
         String indexId = message.getHeader(PineconeVectorDbHeaders.INDEX_ID, 
UUID.randomUUID(), String.class);
-        String indexName = 
message.getHeader(PineconeVectorDbHeaders.INDEX_NAME, "embeddings", 
String.class);
+        // the index name is left unset when the route does not set it, so 
that the producer uses the indexName
+        // of its endpoint; a default here would override the endpoint option, 
as the producer takes the
+        // header over the option
+        String indexName = 
message.getHeader(PineconeVectorDbHeaders.INDEX_NAME, String.class);
+        if (indexName != null) {
+            message.setHeader(PineconeVectorDbHeaders.INDEX_NAME, indexName);
+        }

Review Comment:
   Fixed in 869b1a85ee: the no-op `if (indexName != null)` block is removed.
   
   _Claude Code on behalf of davsclaus_



-- 
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