Home / Function/ _raise_deprecation() — langchain Function Reference

_raise_deprecation() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  c241bd80_7275_1877_777c_af2c946ef70b["_raise_deprecation()"]
  9171cff6_74d4_b785_eb4e_31a83af8c002["NatBotChain"]
  c241bd80_7275_1877_777c_af2c946ef70b -->|defined in| 9171cff6_74d4_b785_eb4e_31a83af8c002
  style c241bd80_7275_1877_777c_af2c946ef70b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/natbot/base.py lines 70–80

    def _raise_deprecation(cls, values: dict) -> Any:
        if "llm" in values:
            warnings.warn(
                "Directly instantiating an NatBotChain with an llm is deprecated. "
                "Please instantiate with llm_chain argument or using the from_llm "
                "class method.",
                stacklevel=5,
            )
            if "llm_chain" not in values and values["llm"] is not None:
                values["llm_chain"] = PROMPT | values["llm"] | StrOutputParser()
        return values

Subdomains

Frequently Asked Questions

What does _raise_deprecation() do?
_raise_deprecation() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/natbot/base.py.
Where is _raise_deprecation() defined?
_raise_deprecation() is defined in libs/langchain/langchain_classic/chains/natbot/base.py at line 70.

Analyze Your Own Codebase

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

Try Supermodel Free