Class swarmauri_core.document_stores.IDocumentStore.IDocumentStore
swarmauri_core.document_stores.IDocumentStore.IDocumentStore
Bases: ABC
Interface for a Document Store responsible for storing, indexing, and retrieving documents.
add_document
abstractmethod
add_document(document)
Stores a single document in the document store.
Parameters: - document (IDocument): The document to store.
Source code in swarmauri_core/document_stores/IDocumentStore.py
11 12 13 14 15 16 17 18 19 |
|
add_documents
abstractmethod
add_documents(documents)
Stores multiple documents in the document store.
Parameters: - documents (List[IDocument]): The list of documents to store.
Source code in swarmauri_core/document_stores/IDocumentStore.py
21 22 23 24 25 26 27 28 29 |
|
get_document
abstractmethod
get_document(doc_id)
Retrieves a document by its ID.
Parameters: - doc_id (str): The unique identifier for the document.
Returns: - Union[IDocument, None]: The requested document, or None if not found.
Source code in swarmauri_core/document_stores/IDocumentStore.py
31 32 33 34 35 36 37 38 39 40 41 42 |
|
get_all_documents
abstractmethod
get_all_documents()
Retrieves all documents stored in the document store.
Returns: - List[IDocument]: A list of all documents.
Source code in swarmauri_core/document_stores/IDocumentStore.py
44 45 46 47 48 49 50 51 52 |
|
delete_document
abstractmethod
delete_document(doc_id)
Deletes a document from the document store by its ID.
Parameters: - doc_id (str): The unique identifier of the document to delete.
Source code in swarmauri_core/document_stores/IDocumentStore.py
54 55 56 57 58 59 60 61 62 |
|
update_document
abstractmethod
update_document(doc_id, updated_document)
Updates a document in the document store.
Parameters: - doc_id (str): The unique identifier for the document to update. - updated_document (IDocument): The updated document object.
Note: It's assumed that the updated_document will retain the same doc_id but may have different content or metadata.
Source code in swarmauri_core/document_stores/IDocumentStore.py
64 65 66 67 68 69 70 71 72 73 74 75 |
|
document_count
abstractmethod
document_count()
Source code in swarmauri_core/document_stores/IDocumentStore.py
77 78 79 |
|