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

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