Class swarmauri_core.document_stores.IDocumentRetrieve.IDocumentRetrieve
swarmauri_core.document_stores.IDocumentRetrieve.IDocumentRetrieve
Bases: ABC
Abstract base class for document retrieval operations.
This class defines the interface for retrieving documents based on a query or other criteria. Implementations may use various indexing or search technologies to fulfill these retrievals.
retrieve
abstractmethod
retrieve(query, top_k=5)
Retrieve the most relevant documents based on the given query.
PARAMETER | DESCRIPTION |
---|---|
query
|
The query string used for document retrieval.
TYPE:
|
top_k
|
The number of top relevant documents to retrieve.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
List[IDocument]
|
List[Document]: A list of the top_k most relevant documents. |
Source code in swarmauri_core/document_stores/IDocumentRetrieve.py
14 15 16 17 18 19 20 21 22 23 24 25 26 |
|