Run more documents through the embeddings and add to the vectorstore. Args: documents: Documents to add to the vectorstore. Returns: List of IDs of the added texts.
(self, documents: List[Document], **kwargs: Any)
| 189 | return await run_in_executor(None, self.add_texts, texts, metadatas, **kwargs) |
| 190 | |
| 191 | def add_documents(self, documents: List[Document], **kwargs: Any) -> List[str]: |
| 192 | """Run more documents through the embeddings and add to the vectorstore. |
| 193 | |
| 194 | Args: |
| 195 | documents: Documents to add to the vectorstore. |
| 196 | |
| 197 | Returns: |
| 198 | List of IDs of the added texts. |
| 199 | """ |
| 200 | # TODO: Handle the case where the user doesn't provide ids on the Collection |
| 201 | texts = [doc.page_content for doc in documents] |
| 202 | metadatas = [doc.metadata for doc in documents] |
| 203 | return self.add_texts(texts, metadatas, **kwargs) |
| 204 | |
| 205 | async def aadd_documents( |
| 206 | self, documents: List[Document], **kwargs: Any |