Find answers from the community

n
nyx-12
Offline, last seen 3 months ago
Joined September 25, 2024
n
nyx-12
·

Pinecone

Hey guys, I'm trying to index documents loaded in pinecone as below. However I get this error. Anyone with an idea on how I can solve this?

AttributeError: 'str' object has no attribute 'upsert'
----> 6 index = GPTVectorStoreIndex.from_documents(documents, storage_context=storage_context)

Code chunk:
coppervstore = PineconeVectorStore(
pinecone_index=index_name,
add_sparse_vector=True,
)
storage_context = StorageContext.from_defaults(vector_store=coppervstore)
index = GPTVectorStoreIndex.from_documents(documents, storage_context=storage_context)
14 comments
L
n
n
nyx-12
·

Pinecone

AttributeError Traceback (most recent call last)
<ipython-input-10-c60941fc391f> in <cell line: 4>()
2 vectore_store = PineconeVectorStore(pinecone_index=pinecone_index)
3 storage_context = StorageContext.from_defaults(vector_store=vectore_store)
----> 4 index = GPTVectorStoreIndex.from_documents(documents, storage_context=storage_context)

7 frames
/usr/local/lib/python3.10/dist-packages/llama_index/vector_stores/pinecone.py in add(self, embedding_results)
207 )[0]
208 entry.update({"sparse_values": sparse_vector})
--> 209 self._pinecone_index.upsert(
210 [entry], namespace=self._namespace, **self._insert_kwargs
211 )

AttributeError: 'str' object has no attribute 'upsert'
16 comments
n
L