Home / Function/ test_fetch_last_ai_and_tool_messages_ai_without_tool_calls() — langchain Function Reference

test_fetch_last_ai_and_tool_messages_ai_without_tool_calls() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  25661a46_f965_024e_82fd_f57f226f91e0["test_fetch_last_ai_and_tool_messages_ai_without_tool_calls()"]
  377b132d_d3e1_0d37_8fdd_618ce0d34bb1["test_fetch_last_ai_and_tool_messages.py"]
  25661a46_f965_024e_82fd_f57f226f91e0 -->|defined in| 377b132d_d3e1_0d37_8fdd_618ce0d34bb1
  style 25661a46_f965_024e_82fd_f57f226f91e0 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 95–107

def test_fetch_last_ai_and_tool_messages_ai_without_tool_calls() -> None:
    """Test AIMessage without tool_calls returns empty tool messages list."""
    messages = [
        HumanMessage(content="Hello"),
        AIMessage(content="Hi! How can I help you today?"),
    ]

    ai_msg, tool_msgs = _fetch_last_ai_and_tool_messages(messages)

    assert ai_msg is not None
    assert isinstance(ai_msg, AIMessage)
    assert ai_msg.content == "Hi! How can I help you today?"
    assert len(tool_msgs) == 0

Domain

Subdomains

Frequently Asked Questions

What does test_fetch_last_ai_and_tool_messages_ai_without_tool_calls() do?
test_fetch_last_ai_and_tool_messages_ai_without_tool_calls() 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_ai_without_tool_calls() defined?
test_fetch_last_ai_and_tool_messages_ai_without_tool_calls() is defined in libs/langchain_v1/tests/unit_tests/agents/test_fetch_last_ai_and_tool_messages.py at line 95.

Analyze Your Own Codebase

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

Try Supermodel Free