_load_llm_math_chain() — langchain Function Reference
Architecture documentation for the _load_llm_math_chain() function in loading.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 699d9513_aed9_a760_8841_689651472192["_load_llm_math_chain()"] 61dd5a0b_3bf7_b973_6dac_edfd465b21fb["loading.py"] 699d9513_aed9_a760_8841_689651472192 -->|defined in| 61dd5a0b_3bf7_b973_6dac_edfd465b21fb 7c915b91_f326_1908_9969_d0cb1f4f7e34["load_chain_from_config()"] 699d9513_aed9_a760_8841_689651472192 -->|calls| 7c915b91_f326_1908_9969_d0cb1f4f7e34 ab90e794_4e78_646b_dee9_e87a00250d94["load_chain()"] 699d9513_aed9_a760_8841_689651472192 -->|calls| ab90e794_4e78_646b_dee9_e87a00250d94 50b2ba2d_27b4_d3bb_0ff2_3f113f11320a["load_llm()"] 699d9513_aed9_a760_8841_689651472192 -->|calls| 50b2ba2d_27b4_d3bb_0ff2_3f113f11320a style 699d9513_aed9_a760_8841_689651472192 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/chains/loading.py lines 312–337
def _load_llm_math_chain(config: dict, **kwargs: Any) -> LLMMathChain:
llm_chain = None
if "llm_chain" in config:
llm_chain_config = config.pop("llm_chain")
llm_chain = load_chain_from_config(llm_chain_config, **kwargs)
elif "llm_chain_path" in config:
llm_chain = load_chain(config.pop("llm_chain_path"), **kwargs)
# llm attribute is deprecated in favor of llm_chain, here to support old configs
elif "llm" in config:
llm_config = config.pop("llm")
llm = load_llm_from_config(llm_config, **kwargs)
# llm_path attribute is deprecated in favor of llm_chain_path,
# its to support old configs
elif "llm_path" in config:
llm = load_llm(config.pop("llm_path"), **kwargs)
else:
msg = "One of `llm_chain` or `llm_chain_path` must be present."
raise ValueError(msg)
if "prompt" in config:
prompt_config = config.pop("prompt")
prompt = load_prompt_from_config(prompt_config)
elif "prompt_path" in config:
prompt = load_prompt(config.pop("prompt_path"))
if llm_chain:
return LLMMathChain(llm_chain=llm_chain, prompt=prompt, **config)
return LLMMathChain(llm=llm, prompt=prompt, **config)
Domain
Subdomains
Source
Frequently Asked Questions
What does _load_llm_math_chain() do?
_load_llm_math_chain() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/loading.py.
Where is _load_llm_math_chain() defined?
_load_llm_math_chain() is defined in libs/langchain/langchain_classic/chains/loading.py at line 312.
What does _load_llm_math_chain() call?
_load_llm_math_chain() calls 3 function(s): load_chain, load_chain_from_config, load_llm.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free