The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
core[patch]: Add doc-string to document compressor (#23085)
Eugene Yurtseva34e650f8bab
diff --git a/libs/core/langchain_core/documents/compressor.py b/libs/core/langchain_core/documents/compressor.pyindex 228caf660a..6ed597a1e5 100644--- a/libs/core/langchain_core/documents/compressor.py+++ b/libs/core/langchain_core/documents/compressor.py@@ -10,7 +10,20 @@ from langchain_core.runnables import run_in_executorclass 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.+ """@abstractmethoddef compress_documents(