From a80158934ef37884eaff49eeeb5d42eaf665d1df Mon Sep 17 00:00:00 2001 From: Ryan Lambert <ryan.g.lambert@gmail.com> Date: Sat, 25 Feb 2023 01:48:34 -0500 Subject: [PATCH] correcting behavior of upsert (#539) --- gpt_index/vector_stores/pinecone.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/gpt_index/vector_stores/pinecone.py b/gpt_index/vector_stores/pinecone.py index c893986067..2db6eea069 100644 --- a/gpt_index/vector_stores/pinecone.py +++ b/gpt_index/vector_stores/pinecone.py @@ -7,7 +7,6 @@ An index that that is built on top of an existing vector store. from typing import Any, Dict, List, Optional, cast from gpt_index.data_structs.data_structs import Node -from gpt_index.utils import get_new_id from gpt_index.vector_stores.types import ( NodeEmbeddingResult, VectorStore, @@ -70,14 +69,6 @@ class PineconeVectorStore(VectorStore): node = result.node text_embedding = result.embedding - # assign a new_id if current_id conflicts with existing ids - while True: - fetch_result = self._pinecone_index.fetch( - [new_id], **self._pinecone_kwargs - ) - if len(fetch_result["vectors"]) == 0: - break - new_id = get_new_id(set()) metadata = { "text": node.get_text(), "doc_id": result.doc_id, -- GitLab