Construct an agent from an LLM and tools.
property finish_tool_name: str#
Name of the tool to use to finish the chain.
property llm_prefix: str#
Prefix to append the llm call with.
property observation_prefix: str#
Prefix to append the observation with.
pydantic model langchain.agents.MRKLChain[source]#
Chain that implements the MRKL system.
Example
from langchain import OpenAI, MRKLChain
from langchain.chains.mrkl.base import ChainConfig
llm = OpenAI(temperature=0)
prompt = PromptTemplate(...)
chains = [...]
mrkl = MRKLChain.from_chains(llm=llm, prompt=prompt)
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]#
classmethod from_chains(llm: langchain.llms.base.BaseLLM, chains: List[langchain.agents.mrkl.base.ChainConfig], **kwargs: Any) → langchain.agents.agent.AgentExecutor[source]#
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.
Parameters
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.
Example