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
  6c73681c_4187_8625_a31b_eb937dd65f53["_raise_deprecation()"]
  781ec1fc_a277_bc9a_9bc4_a35f09bdb247["LLMMathChain"]
  6c73681c_4187_8625_a31b_eb937dd65f53 -->|defined in| 781ec1fc_a277_bc9a_9bc4_a35f09bdb247
  style 6c73681c_4187_8625_a31b_eb937dd65f53 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/llm_math/base.py lines 169–188

    def _raise_deprecation(cls, values: dict) -> Any:
        try:
            import numexpr  # noqa: F401
        except ImportError as e:
            msg = (
                "LLMMathChain requires the numexpr package. "
                "Please install it with `pip install numexpr`."
            )
            raise ImportError(msg) from e
        if "llm" in values:
            warnings.warn(
                "Directly instantiating an LLMMathChain 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:
                prompt = values.get("prompt", PROMPT)
                values["llm_chain"] = LLMChain(llm=values["llm"], prompt=prompt)
        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/llm_math/base.py.
Where is _raise_deprecation() defined?
_raise_deprecation() is defined in libs/langchain/langchain_classic/chains/llm_math/base.py at line 169.

Analyze Your Own Codebase

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

Try Supermodel Free