Home / Function/ test_get_buffer_string_all_custom_prefixes() — langchain Function Reference

test_get_buffer_string_all_custom_prefixes() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/messages/test_utils.py lines 2682–2706

def test_get_buffer_string_all_custom_prefixes() -> None:
    """Test `get_buffer_string` with all custom prefixes."""
    messages: list[BaseMessage] = [
        SystemMessage(content="System says hello"),
        HumanMessage(content="Human says hello"),
        AIMessage(content="AI says hello"),
        FunctionMessage(name="func", content="Function says hello"),
        ToolMessage(tool_call_id="call_1", content="Tool says hello"),
    ]
    result = get_buffer_string(
        messages,
        human_prefix="User",
        ai_prefix="Assistant",
        system_prefix="Sys",
        function_prefix="Fn",
        tool_prefix="T",
    )
    expected = (
        "Sys: System says hello\n"
        "User: Human says hello\n"
        "Assistant: AI says hello\n"
        "Fn: Function says hello\n"
        "T: Tool says hello"
    )
    assert result == expected

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free