mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 03:12:15 +00:00
feat: Update Pinecone Vector Store node to support serverless environments (#8849)
Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
@@ -21,13 +21,6 @@ export class PineconeApi implements ICredentialType {
|
||||
required: true,
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Environment',
|
||||
name: 'environment',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: 'us-central1-gcp',
|
||||
},
|
||||
];
|
||||
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
@@ -41,7 +34,7 @@ export class PineconeApi implements ICredentialType {
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '=https://controller.{{$credentials.environment}}.pinecone.io/databases',
|
||||
baseURL: 'https://api.pinecone.io/indexes',
|
||||
headers: {
|
||||
accept: 'application/json; charset=utf-8',
|
||||
},
|
||||
|
||||
@@ -124,7 +124,13 @@ export const VectorStorePinecone = createVectorStoreNode({
|
||||
const pineconeIndex = client.Index(index);
|
||||
|
||||
if (options.pineconeNamespace && options.clearNamespace) {
|
||||
await pineconeIndex.namespace(options.pineconeNamespace).deleteAll();
|
||||
const namespace = pineconeIndex.namespace(options.pineconeNamespace);
|
||||
try {
|
||||
await namespace.deleteAll();
|
||||
} catch (error) {
|
||||
// Namespace doesn't exist yet
|
||||
context.logger.info(`Namespace ${options.pineconeNamespace} does not exist yet`);
|
||||
}
|
||||
}
|
||||
|
||||
await PineconeStore.fromDocuments(documents, embeddings, {
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
"@langchain/redis": "^0.0.2",
|
||||
"@n8n/typeorm": "0.3.20-3",
|
||||
"@n8n/vm2": "3.9.20",
|
||||
"@pinecone-database/pinecone": "2.0.1",
|
||||
"@pinecone-database/pinecone": "2.1.0",
|
||||
"@qdrant/js-client-rest": "1.7.0",
|
||||
"@supabase/supabase-js": "2.38.5",
|
||||
"@xata.io/client": "0.28.0",
|
||||
|
||||
Reference in New Issue
Block a user