Home / Function/ test_get_buffer_string_with_tool_calls() — langchain Function Reference

test_get_buffer_string_with_tool_calls() — langchain Function Reference

Architecture documentation for the test_get_buffer_string_with_tool_calls() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  38546e1e_3174_a26f_3ffa_9a4e75128742["test_get_buffer_string_with_tool_calls()"]
  03f6a5ae_d57a_eb66_626a_b9e082b763ea["test_utils.py"]
  38546e1e_3174_a26f_3ffa_9a4e75128742 -->|defined in| 03f6a5ae_d57a_eb66_626a_b9e082b763ea
  style 38546e1e_3174_a26f_3ffa_9a4e75128742 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 1756–1776

def test_get_buffer_string_with_tool_calls() -> None:
    """Test `get_buffer_string` with `tool_calls` field."""
    messages = [
        HumanMessage(content="What's the weather?"),
        AIMessage(
            content="Let me check the weather",
            tool_calls=[
                {
                    "name": "get_weather",
                    "args": {"city": "NYC"},
                    "id": "call_1",
                    "type": "tool_call",
                }
            ],
        ),
    ]
    result = get_buffer_string(messages)
    assert "Human: What's the weather?" in result
    assert "AI: Let me check the weather" in result
    assert "get_weather" in result
    assert "NYC" in result

Domain

Subdomains

Frequently Asked Questions

What does test_get_buffer_string_with_tool_calls() do?
test_get_buffer_string_with_tool_calls() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/test_utils.py.
Where is test_get_buffer_string_with_tool_calls() defined?
test_get_buffer_string_with_tool_calls() is defined in libs/core/tests/unit_tests/messages/test_utils.py at line 1756.

Analyze Your Own Codebase

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

Try Supermodel Free