test_agent_stopped_early() — langchain Function Reference
Architecture documentation for the test_agent_stopped_early() function in test_agent.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 6cbeb4f4_3c6e_44dd_4687_6a309a4c183e["test_agent_stopped_early()"] 47a7b285_8e60_f78f_282d_429958c446fa["test_agent.py"] 6cbeb4f4_3c6e_44dd_4687_6a309a4c183e -->|defined in| 47a7b285_8e60_f78f_282d_429958c446fa 14f78f65_e4e5_9e87_0c7c_292f4c2d21f0["_get_agent()"] 6cbeb4f4_3c6e_44dd_4687_6a309a4c183e -->|calls| 14f78f65_e4e5_9e87_0c7c_292f4c2d21f0 style 6cbeb4f4_3c6e_44dd_4687_6a309a4c183e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_agent.py lines 121–131
def test_agent_stopped_early() -> None:
"""Test react chain when max iterations or max execution time is exceeded."""
# iteration limit
agent = _get_agent(max_iterations=0)
output = agent.run("when was langchain made")
assert output == "Agent stopped due to iteration limit or time limit."
# execution time limit
agent = _get_agent(max_execution_time=0.0)
output = agent.run("when was langchain made")
assert output == "Agent stopped due to iteration limit or time limit."
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does test_agent_stopped_early() do?
test_agent_stopped_early() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_agent.py.
Where is test_agent_stopped_early() defined?
test_agent_stopped_early() is defined in libs/langchain/tests/unit_tests/agents/test_agent.py at line 121.
What does test_agent_stopped_early() call?
test_agent_stopped_early() calls 1 function(s): _get_agent.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free