core[patch]: Add doc-string to document compressor (#23085)

pull/23133/head^2
Eugene Yurtsev 3 months ago committed by GitHub
parent 1007a715a5
commit a34e650f8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -10,7 +10,20 @@ from langchain_core.runnables import run_in_executor
class BaseDocumentCompressor(BaseModel, ABC):
"""Base class for document compressors."""
"""Base class for document compressors.
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.
**Note** users should favor using a RunnableLambda
instead of sub-classing from this interface.
"""
@abstractmethod
def compress_documents(

Loading…
Cancel
Save