Home / Function/ _load_stuff_chain() — langchain Function Reference

_load_stuff_chain() — langchain Function Reference

Architecture documentation for the _load_stuff_chain() function in loading.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  93c9902c_dfe5_6999_2a5f_2c50667f7622["_load_stuff_chain()"]
  bca47bc4_997d_4fc4_b050_2e6593c54792["loading.py"]
  93c9902c_dfe5_6999_2a5f_2c50667f7622 -->|defined in| bca47bc4_997d_4fc4_b050_2e6593c54792
  style 93c9902c_dfe5_6999_2a5f_2c50667f7622 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/qa_with_sources/loading.py lines 64–80

def _load_stuff_chain(
    llm: BaseLanguageModel,
    *,
    prompt: BasePromptTemplate = stuff_prompt.PROMPT,
    document_prompt: BasePromptTemplate = stuff_prompt.EXAMPLE_PROMPT,
    document_variable_name: str = "summaries",
    verbose: bool | None = None,
    **kwargs: Any,
) -> StuffDocumentsChain:
    llm_chain = LLMChain(llm=llm, prompt=prompt, verbose=verbose)
    return StuffDocumentsChain(
        llm_chain=llm_chain,
        document_variable_name=document_variable_name,
        document_prompt=document_prompt,
        verbose=verbose,
        **kwargs,
    )

Subdomains

Frequently Asked Questions

What does _load_stuff_chain() do?
_load_stuff_chain() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/qa_with_sources/loading.py.
Where is _load_stuff_chain() defined?
_load_stuff_chain() is defined in libs/langchain/langchain_classic/chains/qa_with_sources/loading.py at line 64.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free