Documents
These are the core chains for working with documents. They are useful for summarizing documents, answering questions over documents, extracting information from documents, and more.
These chains all implement a common interface:
class BaseCombineDocumentsChain(Chain, ABC):
"""Base interface for chains combining documents."""
@abstractmethod
def combine_docs(self, docs: List[Document], **kwargs: Any) -> Tuple[str, dict]:
"""Combine documents into a single string."""
📄️ Stuff
The stuff documents chain (“stuff” as in “to stuff” or “to fill”) is the
📄️ Refine
refine}
📄️ Map reduce
The map reduce documents chain first applies an LLM chain to each
📄️ Map re-rank
The map re-rank documents chain runs an initial prompt on each document,