diff --git a/langchain/vectorstores/pinecone.py b/langchain/vectorstores/pinecone.py index 1f0d09a3..6dfef7b7 100644 --- a/langchain/vectorstores/pinecone.py +++ b/langchain/vectorstores/pinecone.py @@ -56,6 +56,7 @@ class Pinecone(VectorStore): metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, namespace: Optional[str] = None, + batch_size: int = 32, **kwargs: Any, ) -> List[str]: """Run more texts through the embeddings and add to the vectorstore. @@ -79,7 +80,7 @@ class Pinecone(VectorStore): metadata[self._text_key] = text docs.append((ids[i], embedding, metadata)) # upsert to Pinecone - self._index.upsert(vectors=docs, namespace=namespace) + self._index.upsert(vectors=docs, namespace=namespace, batch_size=batch_size) return ids def similarity_search_with_score(