test_agent_iterator_reset() — langchain Function Reference
Architecture documentation for the test_agent_iterator_reset() function in test_agent_iterator.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 55e2bbdb_4ee2_e468_9c6f_931c8b0bde82["test_agent_iterator_reset()"] 2423e003_42f4_7c6a_3fba_30db54c07a0c["test_agent_iterator.py"] 55e2bbdb_4ee2_e468_9c6f_931c8b0bde82 -->|defined in| 2423e003_42f4_7c6a_3fba_30db54c07a0c style 55e2bbdb_4ee2_e468_9c6f_931c8b0bde82 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_agent_iterator.py lines 274–295
def test_agent_iterator_reset() -> None:
"""Test reset functionality of AgentExecutorIterator."""
agent = _get_agent()
agent_iter = agent.iter(inputs="when was langchain made")
assert isinstance(agent_iter, AgentExecutorIterator)
# Perform one iteration
iterator = iter(agent_iter)
next(iterator)
# Check if properties are updated
assert agent_iter.iterations == 1
assert agent_iter.time_elapsed > 0.0
assert agent_iter.intermediate_steps
# Reset the iterator
agent_iter.reset()
# Check if properties are reset
assert agent_iter.iterations == 0
assert agent_iter.time_elapsed == 0.0
assert not agent_iter.intermediate_steps
Domain
Subdomains
Source
Frequently Asked Questions
What does test_agent_iterator_reset() do?
test_agent_iterator_reset() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_agent_iterator.py.
Where is test_agent_iterator_reset() defined?
test_agent_iterator_reset() is defined in libs/langchain/tests/unit_tests/agents/test_agent_iterator.py at line 274.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free