Home / Function/ from_llm() — langchain Function Reference

from_llm() — langchain Function Reference

Architecture documentation for the from_llm() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c16575c9_7d3c_386e_2f1e_286d9846f11f["from_llm()"]
  9171cff6_74d4_b785_eb4e_31a83af8c002["NatBotChain"]
  c16575c9_7d3c_386e_2f1e_286d9846f11f -->|defined in| 9171cff6_74d4_b785_eb4e_31a83af8c002
  f5dc12b9_763d_923e_5f22_bd38cf4d8fa7["from_default()"]
  f5dc12b9_763d_923e_5f22_bd38cf4d8fa7 -->|calls| c16575c9_7d3c_386e_2f1e_286d9846f11f
  style c16575c9_7d3c_386e_2f1e_286d9846f11f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/natbot/base.py lines 93–101

    def from_llm(
        cls,
        llm: BaseLanguageModel,
        objective: str,
        **kwargs: Any,
    ) -> NatBotChain:
        """Load from LLM."""
        llm_chain = PROMPT | llm | StrOutputParser()
        return cls(llm_chain=llm_chain, objective=objective, **kwargs)

Subdomains

Called By

Frequently Asked Questions

What does from_llm() do?
from_llm() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/natbot/base.py.
Where is from_llm() defined?
from_llm() is defined in libs/langchain/langchain_classic/chains/natbot/base.py at line 93.
What calls from_llm()?
from_llm() is called by 1 function(s): from_default.

Analyze Your Own Codebase

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

Try Supermodel Free