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
  f272a350_2fd9_70c0_9de4_c963a07940fa["_raise_deprecation()"]
  5aa56bcf_82c4_0170_f600_dbc266dbf61b["LLMCheckerChain"]
  f272a350_2fd9_70c0_9de4_c963a07940fa -->|defined in| 5aa56bcf_82c4_0170_f600_dbc266dbf61b
  98907bf7_2811_e9e1_0faa_d8951a890e3a["_load_question_to_checked_assertions_chain()"]
  f272a350_2fd9_70c0_9de4_c963a07940fa -->|calls| 98907bf7_2811_e9e1_0faa_d8951a890e3a
  style f272a350_2fd9_70c0_9de4_c963a07940fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/llm_checker/base.py lines 110–137

    def _raise_deprecation(cls, values: dict) -> Any:
        if "llm" in values:
            warnings.warn(
                "Directly instantiating an LLMCheckerChain with an llm is deprecated. "
                "Please instantiate with question_to_checked_assertions_chain "
                "or using the from_llm class method.",
                stacklevel=5,
            )
            if (
                "question_to_checked_assertions_chain" not in values
                and values["llm"] is not None
            ):
                question_to_checked_assertions_chain = (
                    _load_question_to_checked_assertions_chain(
                        values["llm"],
                        values.get(
                            "create_draft_answer_prompt",
                            CREATE_DRAFT_ANSWER_PROMPT,
                        ),
                        values.get("list_assertions_prompt", LIST_ASSERTIONS_PROMPT),
                        values.get("check_assertions_prompt", CHECK_ASSERTIONS_PROMPT),
                        values.get("revised_answer_prompt", REVISED_ANSWER_PROMPT),
                    )
                )
                values["question_to_checked_assertions_chain"] = (
                    question_to_checked_assertions_chain
                )
        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_checker/base.py.
Where is _raise_deprecation() defined?
_raise_deprecation() is defined in libs/langchain/langchain_classic/chains/llm_checker/base.py at line 110.
What does _raise_deprecation() call?
_raise_deprecation() calls 1 function(s): _load_question_to_checked_assertions_chain.

Analyze Your Own Codebase

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

Try Supermodel Free