Home / Function/ test_agent_name_on_multiple_iterations() — langchain Function Reference

test_agent_name_on_multiple_iterations() — langchain Function Reference

Architecture documentation for the test_agent_name_on_multiple_iterations() function in test_agent_name.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  dacce97d_e419_dfe6_c5ca_67bdaab0bc2f["test_agent_name_on_multiple_iterations()"]
  855858ac_82a7_eb82_4d23_1dd8507dbcbb["test_agent_name.py"]
  dacce97d_e419_dfe6_c5ca_67bdaab0bc2f -->|defined in| 855858ac_82a7_eb82_4d23_1dd8507dbcbb
  style dacce97d_e419_dfe6_c5ca_67bdaab0bc2f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_agent_name.py lines 54–69

def test_agent_name_on_multiple_iterations() -> None:
    """Test that agent name is set on all AIMessages in multi-turn conversation."""
    agent = create_agent(
        model=FakeToolCallingModel(
            tool_calls=[[{"args": {"x": 1}, "id": "call_1", "name": "simple_tool"}], []]
        ),
        tools=[simple_tool],
        name="multi_turn_agent",
    )

    result = agent.invoke({"messages": [HumanMessage("Call a tool")]})

    ai_messages = [m for m in result["messages"] if isinstance(m, AIMessage)]
    assert len(ai_messages) == 2
    for msg in ai_messages:
        assert msg.name == "multi_turn_agent"

Domain

Subdomains

Frequently Asked Questions

What does test_agent_name_on_multiple_iterations() do?
test_agent_name_on_multiple_iterations() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/test_agent_name.py.
Where is test_agent_name_on_multiple_iterations() defined?
test_agent_name_on_multiple_iterations() is defined in libs/langchain_v1/tests/unit_tests/agents/test_agent_name.py at line 54.

Analyze Your Own Codebase

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

Try Supermodel Free