Home / Function/ test_agent_name_not_set_when_none() — langchain Function Reference

test_agent_name_not_set_when_none() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_agent_name.py lines 40–51

def test_agent_name_not_set_when_none() -> None:
    """Test that AIMessage.name is not set when name is not provided."""
    tool_calls: list[list[ToolCall]] = [[]]
    agent = create_agent(
        model=FakeToolCallingModel(tool_calls=tool_calls),
    )

    result = agent.invoke({"messages": [HumanMessage("Hello")]})

    ai_messages = [m for m in result["messages"] if isinstance(m, AIMessage)]
    assert len(ai_messages) == 1
    assert ai_messages[0].name is None

Domain

Subdomains

Frequently Asked Questions

What does test_agent_name_not_set_when_none() do?
test_agent_name_not_set_when_none() 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_not_set_when_none() defined?
test_agent_name_not_set_when_none() is defined in libs/langchain_v1/tests/unit_tests/agents/test_agent_name.py at line 40.

Analyze Your Own Codebase

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

Try Supermodel Free