swarmauri.standard.document_stores.base.DocumentStoreBase module
- class swarmauri.standard.document_stores.base.DocumentStoreBase.DocumentStoreBase[source]
Bases:
IDocumentStore
,ABC
Abstract base class for document stores, implementing the IDocumentStore interface.
This class provides a standard API for adding, updating, getting, and deleting documents in a store. The specifics of storing (e.g., in a database, in-memory, or file system) are to be implemented by concrete subclasses.
- abstract add_document(document)[source]
Add a single document to the document store.
Parameters: - document (IDocument): The document to be added to the store.
- Return type:
None
- abstract add_documents(documents)[source]
Add multiple documents to the document store in a batch operation.
Parameters: - documents (List[IDocument]): A list of documents to be added to the store.
- Return type:
None
- abstract delete_document(doc_id)[source]
Delete a document from the document store by its identifier.
Parameters: - doc_id (str): The unique identifier of the document to delete.
- Return type:
None
- abstract get_all_documents()[source]
Retrieve all documents stored in the document store.
Returns: - List[IDocument]: A list of all documents in the store.
- Return type:
List
[IDocument
]