from_chains() — langchain Function Reference
Architecture documentation for the from_chains() function in base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD d76c1f53_4db7_bb60_a9d5_23fc16890cf0["from_chains()"] 32fdcb01_4c25_5670_f8e5_6fa8ce84181e["MRKLChain"] d76c1f53_4db7_bb60_a9d5_23fc16890cf0 -->|defined in| 32fdcb01_4c25_5670_f8e5_6fa8ce84181e f50a836d_579d_7ed4_e51f_6bb4bd0b8059["from_llm_and_tools()"] d76c1f53_4db7_bb60_a9d5_23fc16890cf0 -->|calls| f50a836d_579d_7ed4_e51f_6bb4bd0b8059 style d76c1f53_4db7_bb60_a9d5_23fc16890cf0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/agents/mrkl/base.py lines 188–216
def from_chains(
cls,
llm: BaseLanguageModel,
chains: list[ChainConfig],
**kwargs: Any,
) -> AgentExecutor:
"""User-friendly way to initialize the MRKL chain.
This is intended to be an easy way to get up and running with the
MRKL chain.
Args:
llm: The LLM to use as the agent LLM.
chains: The chains the MRKL system has access to.
**kwargs: parameters to be passed to initialization.
Returns:
An initialized MRKL chain.
"""
tools = [
Tool(
name=c.action_name,
func=c.action,
description=c.action_description,
)
for c in chains
]
agent = ZeroShotAgent.from_llm_and_tools(llm, tools)
return cls(agent=agent, tools=tools, **kwargs)
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does from_chains() do?
from_chains() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/mrkl/base.py.
Where is from_chains() defined?
from_chains() is defined in libs/langchain/langchain_classic/agents/mrkl/base.py at line 188.
What does from_chains() call?
from_chains() calls 1 function(s): from_llm_and_tools.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free