mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-24 20:09:01 +00:00
chore: formatting across codebase (#32466)
This commit is contained in:
@@ -19,17 +19,18 @@ if TYPE_CHECKING:
|
||||
class BaseDocumentCompressor(BaseModel, ABC):
|
||||
"""Base class for document compressors.
|
||||
|
||||
This abstraction is primarily used for
|
||||
post-processing of retrieved documents.
|
||||
This abstraction is primarily used for post-processing of retrieved documents.
|
||||
|
||||
Documents matching a given query are first retrieved.
|
||||
|
||||
Then the list of documents can be further processed.
|
||||
|
||||
For example, one could re-rank the retrieved documents
|
||||
using an LLM.
|
||||
For example, one could re-rank the retrieved documents using an LLM.
|
||||
|
||||
.. note::
|
||||
Users should favor using a RunnableLambda instead of sub-classing from this
|
||||
interface.
|
||||
|
||||
**Note** users should favor using a RunnableLambda
|
||||
instead of sub-classing from this interface.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -48,6 +49,7 @@ class BaseDocumentCompressor(BaseModel, ABC):
|
||||
|
||||
Returns:
|
||||
The compressed documents.
|
||||
|
||||
"""
|
||||
|
||||
async def acompress_documents(
|
||||
@@ -65,6 +67,7 @@ class BaseDocumentCompressor(BaseModel, ABC):
|
||||
|
||||
Returns:
|
||||
The compressed documents.
|
||||
|
||||
"""
|
||||
return await run_in_executor(
|
||||
None, self.compress_documents, documents, query, callbacks
|
||||
|
Reference in New Issue
Block a user