Home / Function/ reset() — langchain Function Reference

reset() — langchain Function Reference

Architecture documentation for the reset() function in agent_iterator.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c1255a97_00b6_d464_ae57_ba7c07bdee0f["reset()"]
  490b6bce_9d4c_017c_89ae_b13ea74223ea["AgentExecutorIterator"]
  c1255a97_00b6_d464_ae57_ba7c07bdee0f -->|defined in| 490b6bce_9d4c_017c_89ae_b13ea74223ea
  4f6760de_4a90_cabd_bc2d_41b34ee0f1da["__init__()"]
  4f6760de_4a90_cabd_bc2d_41b34ee0f1da -->|calls| c1255a97_00b6_d464_ae57_ba7c07bdee0f
  a9a06b32_02d8_cc0e_a2b9_4c37ea88936c["__iter__()"]
  a9a06b32_02d8_cc0e_a2b9_4c37ea88936c -->|calls| c1255a97_00b6_d464_ae57_ba7c07bdee0f
  2930b993_0ef7_2ec8_a8f2_724346ce4dde["__aiter__()"]
  2930b993_0ef7_2ec8_a8f2_724346ce4dde -->|calls| c1255a97_00b6_d464_ae57_ba7c07bdee0f
  style c1255a97_00b6_d464_ae57_ba7c07bdee0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/agent_iterator.py lines 125–136

    def reset(self) -> None:
        """Reset the iterator to its initial state.

        Reset the iterator to its initial state, clearing intermediate steps,
        iterations, and time elapsed.
        """
        logger.debug("(Re)setting AgentExecutorIterator to fresh state")
        self.intermediate_steps: list[tuple[AgentAction, str]] = []
        self.iterations = 0
        # maybe better to start these on the first __anext__ call?
        self.time_elapsed = 0.0
        self.start_time = time.time()

Subdomains

Frequently Asked Questions

What does reset() do?
reset() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent_iterator.py.
Where is reset() defined?
reset() is defined in libs/langchain/langchain_classic/agents/agent_iterator.py at line 125.
What calls reset()?
reset() is called by 3 function(s): __aiter__, __init__, __iter__.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free