feat: Update Pinecone Vector Store node to support serverless environments (#8849)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-03-08 16:01:02 +01:00
committed by GitHub
parent bd465d394a
commit a136a73e4e
4 changed files with 27 additions and 32 deletions

View File

@@ -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',
},

View File

@@ -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, {

View File

@@ -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",