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.
pull/20177/head
Harry Jiang 6 months ago committed by GitHub
parent 5f563e040a
commit 1ee208541c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -166,6 +166,7 @@ class PineconeVectorStore(VectorStore):
batch_size, zip(chunk_ids, embeddings, chunk_metadatas)
)
]
if async_req:
[res.get() for res in async_res]
return ids

Loading…
Cancel
Save