Returns
An initialized MRKL chain.
Example
from langchain import LLMMathChain, OpenAI, SerpAPIWrapper, MRKLChain
from langchain.chains.mrkl.base import ChainConfig
llm = OpenAI(temperature=0)
search = SerpAPIWrapper()
llm_math_chain = LLMMathChain(llm=llm)
chains = [
    ChainConfig(
        action_name = "Search",
        action=search.search,
        action_description="useful for searching"
    ),
    ChainConfig(
        action_name="Calculator",
        action=llm_math_chain.run,
        action_description="useful for doing math"
    )
]
mrkl = MRKLChain.from_chains(llm, chains)
pydantic model langchain.agents.ReActChain[source]#
Chain that implements the ReAct paper.
Example
from langchain import ReActChain, OpenAI
react = ReAct(llm=OpenAI())
Validators
set_callback_manager » callback_manager
set_verbose » verbose
validate_tools » all fields
field agent: Agent [Required]#
field callback_manager: BaseCallbackManager [Optional]#
field early_stopping_method: str = 'force'#
field max_iterations: Optional[int] = 15#
field memory: Optional[BaseMemory] = None#
field return_intermediate_steps: bool = False#
field tools: Sequence[BaseTool] [Required]#
field verbose: bool [Optional]#
pydantic model langchain.agents.ReActTextWorldAgent[source]#
Agent for the ReAct TextWorld chain.
field i: int = 1#
classmethod create_prompt(tools: Sequence[langchain.tools.base.BaseTool]) → langchain.prompts.base.BasePromptTemplate[source]#
Return default prompt.