Create the full inputs for the LLMChain from intermediate steps.
plan(intermediate_steps: List[Tuple[langchain.schema.AgentAction, str]], **kwargs: Any) → Union[langchain.schema.AgentAction, langchain.schema.AgentFinish][source]#
Given input, decided what to do.
Parameters
intermediate_steps – Steps the LLM has taken to date,
along with observations
**kwargs – User inputs.
Returns
Action specifying what tool to use.
prepare_for_new_call() → None[source]#
Prepare the agent for new call, if needed.
return_stopped_response(early_stopping_method: str, intermediate_steps: List[Tuple[langchain.schema.AgentAction, str]], **kwargs: Any) → langchain.schema.AgentFinish[source]#
Return response when agent has been stopped due to max iterations.
save(file_path: Union[pathlib.Path, str]) → None[source]#
Save the agent.
Parameters
file_path – Path to file to save the agent to.
Example:
.. code-block:: python
# If working with agent executor
agent.agent.save(file_path=”path/agent.yaml”)
property finish_tool_name: str#
Name of the tool to use to finish the chain.
abstract property llm_prefix: str#
Prefix to append the LLM call with.
abstract property observation_prefix: str#
Prefix to append the observation with.
pydantic model langchain.agents.AgentExecutor[source]#
Consists of an agent using tools.
Validators
set_callback_manager » callback_manager
set_verbose » verbose
validate_tools » all fields
field agent: Agent [Required]#
field early_stopping_method: str = 'force'#
field max_iterations: Optional[int] = 15#
field return_intermediate_steps: bool = False#
field tools: Sequence[BaseTool] [Required]#