AgentExecutorIterator#
- class langchain.agents.agent_iterator.AgentExecutorIterator(agent_executor: AgentExecutor, inputs: Any, callbacks: Callbacks = None, *, tags: list[str] | None = None, metadata: Dict[str, Any] | None = None, run_name: str | None = None, run_id: UUID | None = None, include_run_info: bool = False, yield_actions: bool = False)[source]#
Iterator for AgentExecutor.
Initialize the AgentExecutorIterator with the given AgentExecutor, inputs, and optional callbacks.
- Parameters:
agent_executor (AgentExecutor) β The AgentExecutor to iterate over.
inputs (Any) β The inputs to the AgentExecutor.
callbacks (Callbacks, optional) β The callbacks to use during iteration. Defaults to None.
tags (Optional[list[str]], optional) β The tags to use during iteration. Defaults to None.
metadata (Optional[Dict[str, Any]], optional) β The metadata to use during iteration. Defaults to None.
run_name (Optional[str], optional) β The name of the run. Defaults to None.
run_id (Optional[UUID], optional) β The ID of the run. Defaults to None.
include_run_info (bool, optional) β Whether to include run info in the output. Defaults to False.
yield_actions (bool, optional) β Whether to yield actions as they are generated. Defaults to False.
Attributes
agent_executor
The AgentExecutor to iterate over.
color_mapping
A mapping of tool names to colors.
inputs
The inputs to the AgentExecutor.
name_to_tool_map
A mapping of tool names to tools.
Methods
__init__
(agent_executor,Β inputs[,Β ...])Initialize the AgentExecutorIterator with the given AgentExecutor, inputs, and optional callbacks.
make_final_outputs
(outputs,Β run_manager)reset
()Reset the iterator to its initial state, clearing intermediate steps, iterations, and time elapsed.
Increment the number of iterations and update the time elapsed.
- __init__(agent_executor: AgentExecutor, inputs: Any, callbacks: Callbacks = None, *, tags: list[str] | None = None, metadata: Dict[str, Any] | None = None, run_name: str | None = None, run_id: UUID | None = None, include_run_info: bool = False, yield_actions: bool = False)[source]#
Initialize the AgentExecutorIterator with the given AgentExecutor, inputs, and optional callbacks.
- Parameters:
agent_executor (AgentExecutor) β The AgentExecutor to iterate over.
inputs (Any) β The inputs to the AgentExecutor.
callbacks (Callbacks, optional) β The callbacks to use during iteration. Defaults to None.
tags (Optional[list[str]], optional) β The tags to use during iteration. Defaults to None.
metadata (Optional[Dict[str, Any]], optional) β The metadata to use during iteration. Defaults to None.
run_name (Optional[str], optional) β The name of the run. Defaults to None.
run_id (Optional[UUID], optional) β The ID of the run. Defaults to None.
include_run_info (bool, optional) β Whether to include run info in the output. Defaults to False.
yield_actions (bool, optional) β Whether to yield actions as they are generated. Defaults to False.
- make_final_outputs(outputs: Dict[str, Any], run_manager: CallbackManagerForChainRun | AsyncCallbackManagerForChainRun) AddableDict [source]#
- Parameters:
outputs (Dict[str, Any])
run_manager (CallbackManagerForChainRun | AsyncCallbackManagerForChainRun)
- Return type: