Home / Function/ test_agent_stopped_early() — langchain Function Reference

test_agent_stopped_early() — langchain Function Reference

Architecture documentation for the test_agent_stopped_early() function in test_agent_async.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1db5bd9b_725f_bb12_8e78_8802e4da6f33["test_agent_stopped_early()"]
  663245d2_2254_328f_5cf8_4bbd36fb32cc["test_agent_async.py"]
  1db5bd9b_725f_bb12_8e78_8802e4da6f33 -->|defined in| 663245d2_2254_328f_5cf8_4bbd36fb32cc
  3f4a2a33_35f0_c575_3ea6_003b91ce484c["_get_agent()"]
  1db5bd9b_725f_bb12_8e78_8802e4da6f33 -->|calls| 3f4a2a33_35f0_c575_3ea6_003b91ce484c
  style 1db5bd9b_725f_bb12_8e78_8802e4da6f33 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/test_agent_async.py lines 92–102

async 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 = await agent.arun("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 = await agent.arun("when was langchain made")
    assert output == "Agent stopped due to iteration limit or time limit."

Domain

Subdomains

Calls

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_async.py.
Where is test_agent_stopped_early() defined?
test_agent_stopped_early() is defined in libs/langchain/tests/unit_tests/agents/test_agent_async.py at line 92.
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