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 4c2523c36f5 Add host to camel-pinecone and fix possible collectionDimension NPE (#17299) 4c2523c36f5 is described below commit 4c2523c36f5b0a8cf89c90a51b97e9a7f8b14b42 Author: Tom Cunningham <tcunn...@redhat.com> AuthorDate: Fri Feb 28 08:50:01 2025 -0500 Add host to camel-pinecone and fix possible collectionDimension NPE (#17299) --- .../apache/camel/catalog/components/pinecone.json | 32 ++++++++++++---------- .../PineconeVectorDbComponentConfigurer.java | 3 ++ .../PineconeVectorDbConfigurationConfigurer.java | 3 ++ .../PineconeVectorDbEndpointConfigurer.java | 3 ++ .../PineconeVectorDbEndpointUriFactory.java | 3 +- .../apache/camel/component/pinecone/pinecone.json | 32 ++++++++++++---------- .../camel/component/pinecone/PineconeVectorDb.java | 1 + .../pinecone/PineconeVectorDbConfiguration.java | 16 ++++++++++- .../pinecone/PineconeVectorDbEndpoint.java | 21 ++++++++++---- .../pinecone/PineconeVectorDbProducer.java | 17 +++++++++--- .../PineconeComponentConfigurationTest.java | 1 + .../src/test/resources/pinecone_index.properties | 4 ++- .../apache/camel/model/ProcessorDefinition.java | 6 ++-- .../dsl/PineconeComponentBuilderFactory.java | 18 ++++++++++++ .../PineconeVectorDbEndpointBuilderFactory.java | 16 +++++++++++ 15 files changed, 130 insertions(+), 46 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pinecone.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pinecone.json index b485013342c..f8d422124a3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pinecone.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/pinecone.json @@ -26,16 +26,17 @@ "componentProperties": { "cloud": { "index": 0, "kind": "property", "displayName": "Cloud", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud type to use (aws\/gcp\/azure)" }, "cloudRegion": { "index": 1, "kind": "property", "displayName": "Cloud Region", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud region" }, - "collectionDimension": { "index": 2, "kind": "property", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, + "collectionDimension": { "index": 2, "kind": "property", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1536", "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, "collectionSimilarityMetric": { "index": 3, "kind": "property", "displayName": "Collection Similarity Metric", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Similarity Metric to use (cosine\/euclidea [...] "configuration": { "index": 4, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration;" }, - "indexName": { "index": 5, "kind": "property", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, - "lazyStartProducer": { "index": 6, "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 [...] - "proxyHost": { "index": 7, "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, - "proxyPort": { "index": 8, "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, - "tls": { "index": 9, "kind": "property", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, - "token": { "index": 10, "kind": "property", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, - "autowiredEnabled": { "index": 11, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] + "host": { "index": 5, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets a custom host URL to connect to" }, + "indexName": { "index": 6, "kind": "property", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, + "lazyStartProducer": { "index": 7, "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 [...] + "proxyHost": { "index": 8, "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, + "proxyPort": { "index": 9, "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, + "tls": { "index": 10, "kind": "property", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, + "token": { "index": 11, "kind": "property", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, + "autowiredEnabled": { "index": 12, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] }, "headers": { "CamelPineconeAction": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "CREATE_COLLECTION", "CREATE_INDEX", "UPSERT", "INSERT", "SEARCH", "DELETE", "UPDATE", "QUERY", "QUERY_BY_ID" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The action to be performed.", "constantName": "org.apache.camel.component.pinecone.PineconeVectorDb$Headers#ACTION" }, @@ -60,13 +61,14 @@ "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" }, "cloud": { "index": 1, "kind": "parameter", "displayName": "Cloud", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud type to use (aws\/gcp\/azure)" }, "cloudRegion": { "index": 2, "kind": "parameter", "displayName": "Cloud Region", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud region" }, - "collectionDimension": { "index": 3, "kind": "parameter", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, + "collectionDimension": { "index": 3, "kind": "parameter", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1536", "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, "collectionSimilarityMetric": { "index": 4, "kind": "parameter", "displayName": "Collection Similarity Metric", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Similarity Metric to use (cosine\/euclide [...] - "indexName": { "index": 5, "kind": "parameter", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, - "proxyHost": { "index": 6, "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, - "proxyPort": { "index": 7, "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, - "tls": { "index": 8, "kind": "parameter", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, - "token": { "index": 9, "kind": "parameter", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, - "lazyStartProducer": { "index": 10, "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 produ [...] + "host": { "index": 5, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets a custom host URL to connect to" }, + "indexName": { "index": 6, "kind": "parameter", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, + "proxyHost": { "index": 7, "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, + "proxyPort": { "index": 8, "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, + "tls": { "index": 9, "kind": "parameter", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, + "token": { "index": 10, "kind": "parameter", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, + "lazyStartProducer": { "index": 11, "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 produ [...] } } diff --git a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbComponentConfigurer.java b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbComponentConfigurer.java index 539cfee4b61..148a4b1a67d 100644 --- a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbComponentConfigurer.java +++ b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbComponentConfigurer.java @@ -40,6 +40,7 @@ public class PineconeVectorDbComponentConfigurer extends PropertyConfigurerSuppo case "collectionsimilaritymetric": case "collectionSimilarityMetric": getOrCreateConfiguration(target).setCollectionSimilarityMetric(property(camelContext, java.lang.String.class, value)); return true; case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.pinecone.PineconeVectorDbConfiguration.class, value)); return true; + case "host": getOrCreateConfiguration(target).setHost(property(camelContext, java.lang.String.class, value)); return true; case "indexname": case "indexName": getOrCreateConfiguration(target).setIndexName(property(camelContext, java.lang.String.class, value)); return true; case "lazystartproducer": @@ -67,6 +68,7 @@ public class PineconeVectorDbComponentConfigurer extends PropertyConfigurerSuppo case "collectionsimilaritymetric": case "collectionSimilarityMetric": return java.lang.String.class; case "configuration": return org.apache.camel.component.pinecone.PineconeVectorDbConfiguration.class; + case "host": return java.lang.String.class; case "indexname": case "indexName": return java.lang.String.class; case "lazystartproducer": @@ -95,6 +97,7 @@ public class PineconeVectorDbComponentConfigurer extends PropertyConfigurerSuppo case "collectionsimilaritymetric": case "collectionSimilarityMetric": return getOrCreateConfiguration(target).getCollectionSimilarityMetric(); case "configuration": return target.getConfiguration(); + case "host": return getOrCreateConfiguration(target).getHost(); case "indexname": case "indexName": return getOrCreateConfiguration(target).getIndexName(); case "lazystartproducer": diff --git a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbConfigurationConfigurer.java b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbConfigurationConfigurer.java index aebba00cc55..00d3f530e7f 100644 --- a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbConfigurationConfigurer.java +++ b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbConfigurationConfigurer.java @@ -31,6 +31,7 @@ public class PineconeVectorDbConfigurationConfigurer extends org.apache.camel.su case "collectionDimension": target.setCollectionDimension(property(camelContext, java.lang.Integer.class, value)); return true; case "collectionsimilaritymetric": case "collectionSimilarityMetric": target.setCollectionSimilarityMetric(property(camelContext, java.lang.String.class, value)); return true; + case "host": target.setHost(property(camelContext, java.lang.String.class, value)); return true; case "indexname": case "indexName": target.setIndexName(property(camelContext, java.lang.String.class, value)); return true; case "proxyhost": @@ -54,6 +55,7 @@ public class PineconeVectorDbConfigurationConfigurer extends org.apache.camel.su case "collectionDimension": return java.lang.Integer.class; case "collectionsimilaritymetric": case "collectionSimilarityMetric": return java.lang.String.class; + case "host": return java.lang.String.class; case "indexname": case "indexName": return java.lang.String.class; case "proxyhost": @@ -78,6 +80,7 @@ public class PineconeVectorDbConfigurationConfigurer extends org.apache.camel.su case "collectionDimension": return target.getCollectionDimension(); case "collectionsimilaritymetric": case "collectionSimilarityMetric": return target.getCollectionSimilarityMetric(); + case "host": return target.getHost(); case "indexname": case "indexName": return target.getIndexName(); case "proxyhost": diff --git a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointConfigurer.java b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointConfigurer.java index 353ccb4c45c..e4ed0559f69 100644 --- a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointConfigurer.java +++ b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointConfigurer.java @@ -30,6 +30,7 @@ public class PineconeVectorDbEndpointConfigurer extends PropertyConfigurerSuppor case "collectionDimension": target.getConfiguration().setCollectionDimension(property(camelContext, java.lang.Integer.class, value)); return true; case "collectionsimilaritymetric": case "collectionSimilarityMetric": target.getConfiguration().setCollectionSimilarityMetric(property(camelContext, java.lang.String.class, value)); return true; + case "host": target.getConfiguration().setHost(property(camelContext, java.lang.String.class, value)); return true; case "indexname": case "indexName": target.getConfiguration().setIndexName(property(camelContext, java.lang.String.class, value)); return true; case "lazystartproducer": @@ -54,6 +55,7 @@ public class PineconeVectorDbEndpointConfigurer extends PropertyConfigurerSuppor case "collectionDimension": return java.lang.Integer.class; case "collectionsimilaritymetric": case "collectionSimilarityMetric": return java.lang.String.class; + case "host": return java.lang.String.class; case "indexname": case "indexName": return java.lang.String.class; case "lazystartproducer": @@ -79,6 +81,7 @@ public class PineconeVectorDbEndpointConfigurer extends PropertyConfigurerSuppor case "collectionDimension": return target.getConfiguration().getCollectionDimension(); case "collectionsimilaritymetric": case "collectionSimilarityMetric": return target.getConfiguration().getCollectionSimilarityMetric(); + case "host": return target.getConfiguration().getHost(); case "indexname": case "indexName": return target.getConfiguration().getIndexName(); case "lazystartproducer": diff --git a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointUriFactory.java b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointUriFactory.java index ea2b1e3323d..37d6ae1f81b 100644 --- a/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointUriFactory.java +++ b/components/camel-ai/camel-pinecone/src/generated/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpointUriFactory.java @@ -23,12 +23,13 @@ public class PineconeVectorDbEndpointUriFactory extends org.apache.camel.support private static final Set<String> SECRET_PROPERTY_NAMES; private static final Set<String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(11); + Set<String> props = new HashSet<>(12); props.add("cloud"); props.add("cloudRegion"); props.add("collection"); props.add("collectionDimension"); props.add("collectionSimilarityMetric"); + props.add("host"); props.add("indexName"); props.add("lazyStartProducer"); props.add("proxyHost"); diff --git a/components/camel-ai/camel-pinecone/src/generated/resources/META-INF/org/apache/camel/component/pinecone/pinecone.json b/components/camel-ai/camel-pinecone/src/generated/resources/META-INF/org/apache/camel/component/pinecone/pinecone.json index b485013342c..f8d422124a3 100644 --- a/components/camel-ai/camel-pinecone/src/generated/resources/META-INF/org/apache/camel/component/pinecone/pinecone.json +++ b/components/camel-ai/camel-pinecone/src/generated/resources/META-INF/org/apache/camel/component/pinecone/pinecone.json @@ -26,16 +26,17 @@ "componentProperties": { "cloud": { "index": 0, "kind": "property", "displayName": "Cloud", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud type to use (aws\/gcp\/azure)" }, "cloudRegion": { "index": 1, "kind": "property", "displayName": "Cloud Region", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud region" }, - "collectionDimension": { "index": 2, "kind": "property", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, + "collectionDimension": { "index": 2, "kind": "property", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1536", "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, "collectionSimilarityMetric": { "index": 3, "kind": "property", "displayName": "Collection Similarity Metric", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Similarity Metric to use (cosine\/euclidea [...] "configuration": { "index": 4, "kind": "property", "displayName": "Configuration", "group": "producer", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "The configuration;" }, - "indexName": { "index": 5, "kind": "property", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, - "lazyStartProducer": { "index": 6, "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 [...] - "proxyHost": { "index": 7, "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, - "proxyPort": { "index": 8, "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, - "tls": { "index": 9, "kind": "property", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, - "token": { "index": 10, "kind": "property", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, - "autowiredEnabled": { "index": 11, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] + "host": { "index": 5, "kind": "property", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets a custom host URL to connect to" }, + "indexName": { "index": 6, "kind": "property", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, + "lazyStartProducer": { "index": 7, "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 [...] + "proxyHost": { "index": 8, "kind": "property", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, + "proxyPort": { "index": 9, "kind": "property", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, + "tls": { "index": 10, "kind": "property", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, + "token": { "index": 11, "kind": "property", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, + "autowiredEnabled": { "index": 12, "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching [...] }, "headers": { "CamelPineconeAction": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "enum": [ "CREATE_COLLECTION", "CREATE_INDEX", "UPSERT", "INSERT", "SEARCH", "DELETE", "UPDATE", "QUERY", "QUERY_BY_ID" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The action to be performed.", "constantName": "org.apache.camel.component.pinecone.PineconeVectorDb$Headers#ACTION" }, @@ -60,13 +61,14 @@ "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" }, "cloud": { "index": 1, "kind": "parameter", "displayName": "Cloud", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud type to use (aws\/gcp\/azure)" }, "cloudRegion": { "index": 2, "kind": "parameter", "displayName": "Cloud Region", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the cloud region" }, - "collectionDimension": { "index": 3, "kind": "parameter", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, + "collectionDimension": { "index": 3, "kind": "parameter", "displayName": "Collection Dimension", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "1536", "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Dimension to use (1-1536)" }, "collectionSimilarityMetric": { "index": 4, "kind": "parameter", "displayName": "Collection Similarity Metric", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the Collection Similarity Metric to use (cosine\/euclide [...] - "indexName": { "index": 5, "kind": "parameter", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, - "proxyHost": { "index": 6, "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, - "proxyPort": { "index": 7, "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, - "tls": { "index": 8, "kind": "parameter", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, - "token": { "index": 9, "kind": "parameter", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, - "lazyStartProducer": { "index": 10, "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 produ [...] + "host": { "index": 5, "kind": "parameter", "displayName": "Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets a custom host URL to connect to" }, + "indexName": { "index": 6, "kind": "parameter", "displayName": "Index Name", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the index name to use" }, + "proxyHost": { "index": 7, "kind": "parameter", "displayName": "Proxy Host", "group": "producer", "label": "producer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy host" }, + "proxyPort": { "index": 8, "kind": "parameter", "displayName": "Proxy Port", "group": "producer", "label": "producer", "required": false, "type": "integer", "javaType": "java.lang.Integer", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Set the proxy port" }, + "tls": { "index": 9, "kind": "parameter", "displayName": "Tls", "group": "producer", "label": "producer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Whether the client uses Transport Layer Security (TLS) to secure communications" }, + "token": { "index": 10, "kind": "parameter", "displayName": "Token", "group": "producer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.pinecone.PineconeVectorDbConfiguration", "configurationField": "configuration", "description": "Sets the API key to use for authentication" }, + "lazyStartProducer": { "index": 11, "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 produ [...] } } diff --git a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDb.java b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDb.java index 923517193c4..a47fd08cdc2 100644 --- a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDb.java +++ b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDb.java @@ -20,6 +20,7 @@ import org.apache.camel.spi.Metadata; public class PineconeVectorDb { public static final String SCHEME = "pinecone"; + public static final int DEFAULT_COLLECTION_DIMENSION = 1536; private PineconeVectorDb() { } diff --git a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbConfiguration.java b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbConfiguration.java index 675b9541ae1..934a3b08846 100644 --- a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbConfiguration.java +++ b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbConfiguration.java @@ -40,7 +40,7 @@ public class PineconeVectorDbConfiguration implements Cloneable { @UriParam(label = "producer") private String collectionSimilarityMetric; - @UriParam(label = "producer") + @UriParam(label = "producer", defaultValue = "1536") private Integer collectionDimension; @UriParam(label = "producer") @@ -58,6 +58,9 @@ public class PineconeVectorDbConfiguration implements Cloneable { @UriParam(defaultValue = "true", label = "producer") private boolean tls; + @UriParam(label = "producer") + private String host; + public String getIndexName() { return indexName; } @@ -146,6 +149,17 @@ public class PineconeVectorDbConfiguration implements Cloneable { this.tls = tls; } + public String getHost() { + return host; + } + + /** + * Sets a custom host URL to connect to + */ + public void setHost(String host) { + this.host = host; + } + public String getToken() { return token; } diff --git a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpoint.java b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpoint.java index cc158b55d24..c40fdfd6eda 100644 --- a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpoint.java +++ b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbEndpoint.java @@ -110,18 +110,27 @@ public class PineconeVectorDbEndpoint extends DefaultEndpoint { private Pinecone createClient() { - Pinecone pinecone; boolean tls = configuration.isTls(); + Pinecone.Builder builder = new Pinecone.Builder(configuration.getToken()); + + // Check to see if a host is configured + if (getConfiguration().getHost() != null) { + builder = builder.withHost(getConfiguration().getHost()); + } + + // if TLS is false, set it + if (!tls) { + builder = builder.withTlsEnabled(tls); + } + // Check to see if a proxyHost/proxyPort pair is configured if ((getConfiguration().getProxyHost() != null) && (getConfiguration().getProxyPort() != null)) { - pinecone = new Pinecone.Builder(configuration.getToken()).withProxy(getConfiguration().getProxyHost(), - getConfiguration().getProxyPort().intValue()).withTlsEnabled(tls).build(); - } else { - pinecone = new Pinecone.Builder(configuration.getToken()).withTlsEnabled(tls).build(); + builder = builder.withProxy(getConfiguration().getProxyHost(), + getConfiguration().getProxyPort().intValue()); } - return pinecone; + return builder.build(); } } diff --git a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java index 70f8c900a17..c1452a8cde7 100644 --- a/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java +++ b/components/camel-ai/camel-pinecone/src/main/java/org/apache/camel/component/pinecone/PineconeVectorDbProducer.java @@ -127,9 +127,14 @@ public class PineconeVectorDbProducer extends DefaultProducer { String indexName = getEndpoint().getConfiguration().getIndexName(); String collectionSimilarityMetricName = getEndpoint().getConfiguration().getCollectionSimilarityMetric(); - int collectionDimension = getEndpoint().getConfiguration().getCollectionDimension().intValue(); + String collectionCloudName = getEndpoint().getConfiguration().getCloud(); String collectionCloudRegionName = getEndpoint().getConfiguration().getCloudRegion(); + int collectionDimension = PineconeVectorDb.DEFAULT_COLLECTION_DIMENSION; + + if (getEndpoint().getConfiguration().getCollectionDimension() != null) { + collectionDimension = getEndpoint().getConfiguration().getCollectionDimension().intValue(); + } if (in.getHeader(PineconeVectorDb.Headers.INDEX_NAME, String.class) != null) { indexName = in.getHeader(PineconeVectorDb.Headers.INDEX_NAME, String.class); @@ -161,18 +166,22 @@ public class PineconeVectorDbProducer extends DefaultProducer { final Message in = exchange.getMessage(); String indexName = getEndpoint().getConfiguration().getIndexName(); String collectionSimilarityMetricName = getEndpoint().getConfiguration().getCollectionSimilarityMetric(); - int collectionDimension = getEndpoint().getConfiguration().getCollectionDimension().intValue(); + int collectionDimension = PineconeVectorDb.DEFAULT_COLLECTION_DIMENSION; + + if (getEndpoint().getConfiguration().getCollectionDimension() != null) { + collectionDimension = getEndpoint().getConfiguration().getCollectionDimension().intValue(); + } if (in.getHeader(PineconeVectorDb.Headers.INDEX_NAME, String.class) != null) { indexName = in.getHeader(PineconeVectorDb.Headers.INDEX_NAME, String.class); } if (in.getHeader(PineconeVectorDb.Headers.COLLECTION_SIMILARITY_METRIC, String.class) != null) { - collectionSimilarityMetricName = getEndpoint().getConfiguration().getCollectionSimilarityMetric(); + collectionSimilarityMetricName = in.getHeader(PineconeVectorDb.Headers.COLLECTION_SIMILARITY_METRIC, String.class); } if (in.getHeader(PineconeVectorDb.Headers.COLLECTION_DIMENSION, Integer.class) != null) { - collectionDimension = getEndpoint().getConfiguration().getCollectionDimension().intValue(); + collectionDimension = in.getHeader(PineconeVectorDb.Headers.COLLECTION_DIMENSION, Integer.class); } String indexPodType = in.getHeader(PineconeVectorDb.Headers.INDEX_POD_TYPE, String.class); diff --git a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeComponentConfigurationTest.java b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeComponentConfigurationTest.java index bf5cd889f69..55c4fc938c7 100644 --- a/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeComponentConfigurationTest.java +++ b/components/camel-ai/camel-pinecone/src/test/java/org/apache/camel/component/pinecone/PineconeComponentConfigurationTest.java @@ -63,6 +63,7 @@ public class PineconeComponentConfigurationTest extends CamelTestSupport { assertEquals("localhost", endpoint.getConfiguration().getProxyHost()); assertEquals(9080, endpoint.getConfiguration().getProxyPort().intValue()); assertEquals(false, endpoint.getConfiguration().isTls()); + assertEquals("http://www.foobar.com", endpoint.getConfiguration().getHost()); } } diff --git a/components/camel-ai/camel-pinecone/src/test/resources/pinecone_index.properties b/components/camel-ai/camel-pinecone/src/test/resources/pinecone_index.properties index 9672dd67b2f..7e44cf53053 100644 --- a/components/camel-ai/camel-pinecone/src/test/resources/pinecone_index.properties +++ b/components/camel-ai/camel-pinecone/src/test/resources/pinecone_index.properties @@ -22,4 +22,6 @@ cloudRegion=us-east-1 proxyHost=localhost proxyPort=9080 -tls=false \ No newline at end of file +tls=false + +host=http://www.foobar.com \ No newline at end of file diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java index 88be9b1717e..8f8c7ae841f 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java @@ -808,11 +808,11 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> /** * Sets the description of this node. * <p/> - * <b>Important:</b> If you want to set the description of the route, then you <b>must</b> use {@link #routeDescription(String)} - * instead. + * <b>Important:</b> If you want to set the description of the route, then you <b>must</b> use + * {@link #routeDescription(String)} instead. * * @param description the description - * @return the builder + * @return the builder */ @Override public Type description(String description) { diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PineconeComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PineconeComponentBuilderFactory.java index 1aff1b0c8f5..5fd6d1f9e64 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PineconeComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PineconeComponentBuilderFactory.java @@ -80,11 +80,13 @@ public interface PineconeComponentBuilderFactory { return this; } + /** * Sets the Collection Dimension to use (1-1536). * * The option is a: <code>java.lang.Integer</code> type. * + * Default: 1536 * Group: producer * * @param collectionDimension the value to set @@ -127,6 +129,21 @@ public interface PineconeComponentBuilderFactory { return this; } + /** + * Sets a custom host URL to connect to. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param host the value to set + * @return the dsl builder + */ + default PineconeComponentBuilder host(java.lang.String host) { + doSetProperty("host", host); + return this; + } + /** * Sets the index name to use. * @@ -277,6 +294,7 @@ public interface PineconeComponentBuilderFactory { case "collectionDimension": getOrCreateConfiguration((PineconeVectorDbComponent) component).setCollectionDimension((java.lang.Integer) value); return true; case "collectionSimilarityMetric": getOrCreateConfiguration((PineconeVectorDbComponent) component).setCollectionSimilarityMetric((java.lang.String) value); return true; case "configuration": ((PineconeVectorDbComponent) component).setConfiguration((org.apache.camel.component.pinecone.PineconeVectorDbConfiguration) value); return true; + case "host": getOrCreateConfiguration((PineconeVectorDbComponent) component).setHost((java.lang.String) value); return true; case "indexName": getOrCreateConfiguration((PineconeVectorDbComponent) component).setIndexName((java.lang.String) value); return true; case "lazyStartProducer": ((PineconeVectorDbComponent) component).setLazyStartProducer((boolean) value); return true; case "proxyHost": getOrCreateConfiguration((PineconeVectorDbComponent) component).setProxyHost((java.lang.String) value); return true; diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PineconeVectorDbEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PineconeVectorDbEndpointBuilderFactory.java index 8ef9071c926..e0530022e09 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PineconeVectorDbEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PineconeVectorDbEndpointBuilderFactory.java @@ -77,6 +77,7 @@ public interface PineconeVectorDbEndpointBuilderFactory { * * The option is a: <code>java.lang.Integer</code> type. * + * Default: 1536 * Group: producer * * @param collectionDimension the value to set @@ -92,6 +93,7 @@ public interface PineconeVectorDbEndpointBuilderFactory { * The option will be converted to a <code>java.lang.Integer</code> * type. * + * Default: 1536 * Group: producer * * @param collectionDimension the value to set @@ -116,6 +118,20 @@ public interface PineconeVectorDbEndpointBuilderFactory { doSetProperty("collectionSimilarityMetric", collectionSimilarityMetric); return this; } + /** + * Sets a custom host URL to connect to. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: producer + * + * @param host the value to set + * @return the dsl builder + */ + default PineconeVectorDbEndpointBuilder host(String host) { + doSetProperty("host", host); + return this; + } /** * Sets the index name to use. *