LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicagentsagent_iteratorAgentExecutorIterator
    Class●Since v1.0

    AgentExecutorIterator

    Iterator for AgentExecutor.

    Copy
    AgentExecutorIterator(
      self,
      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
    )

    Parameters

    NameTypeDescription
    agent_executor*AgentExecutor

    The AgentExecutor to iterate over.

    inputs*Any

    The inputs to the AgentExecutor.

    callbacksCallbacks
    Default:None

    The callbacks to use during iteration.

    tagslist[str] | None
    Default:None

    The tags to use during iteration.

    metadatadict[str, Any] | None
    Default:None

    The metadata to use during iteration.

    run_namestr | None
    Default:None

    The name of the run.

    run_idUUID | None
    Default:None

    The ID of the run.

    include_run_infobool
    Default:False

    Whether to include run info in the output.

    yield_actionsbool
    Default:False

    Whether to yield actions as they are generated.

    Constructors

    constructor
    __init__
    NameType
    agent_executorAgentExecutor
    inputsAny
    callbacksCallbacks
    tagslist[str] | None
    metadatadict[str, Any] | None
    run_namestr | None
    run_idUUID | None
    include_run_infobool
    yield_actionsbool

    Attributes

    attribute
    inputs: dict[str, str]

    The inputs to the AgentExecutor.

    attribute
    callbacks: Callbacks
    attribute
    tags: list[str] | None
    attribute
    metadata: dict[str, Any] | None
    attribute
    run_name: str | None
    attribute
    run_id: UUID | None
    attribute
    include_run_info: bool
    attribute
    yield_actions: bool
    attribute
    agent_executor: AgentExecutor

    The AgentExecutor to iterate over.

    attribute
    name_to_tool_map: dict[str, BaseTool]

    A mapping of tool names to tools.

    attribute
    color_mapping: dict[str, str]

    A mapping of tool names to colors.

    Methods

    method
    reset

    Reset the iterator to its initial state.

    Reset the iterator to its initial state, clearing intermediate steps, iterations, and time elapsed.

    method
    update_iterations

    Increment the number of iterations and update the time elapsed.

    method
    make_final_outputs

    Make final outputs for the iterator.

    View source on GitHub