Home / Function/ test_fetch_last_ai_and_tool_messages_only_human_messages() — langchain Function Reference

test_fetch_last_ai_and_tool_messages_only_human_messages() — langchain Function Reference

Architecture documentation for the test_fetch_last_ai_and_tool_messages_only_human_messages() function in test_fetch_last_ai_and_tool_messages.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a38c4d1f_2bef_c134_afcd_7ee48d3b4ac9["test_fetch_last_ai_and_tool_messages_only_human_messages()"]
  377b132d_d3e1_0d37_8fdd_618ce0d34bb1["test_fetch_last_ai_and_tool_messages.py"]
  a38c4d1f_2bef_c134_afcd_7ee48d3b4ac9 -->|defined in| 377b132d_d3e1_0d37_8fdd_618ce0d34bb1
  style a38c4d1f_2bef_c134_afcd_7ee48d3b4ac9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/test_fetch_last_ai_and_tool_messages.py lines 82–92

def test_fetch_last_ai_and_tool_messages_only_human_messages() -> None:
    """Test handling when only HumanMessages exist."""
    messages = [
        HumanMessage(content="Hello"),
        HumanMessage(content="Are you there?"),
    ]

    ai_msg, tool_msgs = _fetch_last_ai_and_tool_messages(messages)

    assert ai_msg is None
    assert len(tool_msgs) == 0

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free