mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 06:33:41 +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:
committed by
William Fu-Hinthorn
parent
0f0499fd28
commit
be7a55f61e
@@ -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