Skip to content
Snippets Groups Projects
Unverified Commit a8015893 authored by Ryan Lambert's avatar Ryan Lambert Committed by GitHub
Browse files

correcting behavior of upsert (#539)

parent 6646b588
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,6 @@ An index that that is built on top of an existing vector store. ...@@ -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 typing import Any, Dict, List, Optional, cast
from gpt_index.data_structs.data_structs import Node from gpt_index.data_structs.data_structs import Node
from gpt_index.utils import get_new_id
from gpt_index.vector_stores.types import ( from gpt_index.vector_stores.types import (
NodeEmbeddingResult, NodeEmbeddingResult,
VectorStore, VectorStore,
...@@ -70,14 +69,6 @@ class PineconeVectorStore(VectorStore): ...@@ -70,14 +69,6 @@ class PineconeVectorStore(VectorStore):
node = result.node node = result.node
text_embedding = result.embedding 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 = { metadata = {
"text": node.get_text(), "text": node.get_text(),
"doc_id": result.doc_id, "doc_id": result.doc_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment