mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-25 16:13:25 +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:
parent
5f563e040a
commit
1ee208541c
@ -166,7 +166,8 @@ class PineconeVectorStore(VectorStore):
|
|||||||
batch_size, zip(chunk_ids, embeddings, chunk_metadatas)
|
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
|
return ids
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user