mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-09 23:12:38 +00:00
langchain: fix pinecone upsert when async_req is set to False (#19793)
Issue: When async_req is the default value True, pinecone client return the multiprocessing AsyncResult object. When async_req is set to False, pinecone client return the result directly. `[{'upserted_count': 1}]` . Calling get() method will throw an error in this case.
This commit is contained in:
@@ -166,7 +166,8 @@ class PineconeVectorStore(VectorStore):
|
||||
batch_size, zip(chunk_ids, embeddings, chunk_metadatas)
|
||||
)
|
||||
]
|
||||
[res.get() for res in async_res]
|
||||
if async_req:
|
||||
[res.get() for res in async_res]
|
||||
|
||||
return ids
|
||||
|
||||
|
Reference in New Issue
Block a user