Home / Function/ test_custom_template_tool_response() — langchain Function Reference

test_custom_template_tool_response() — langchain Function Reference

Architecture documentation for the test_custom_template_tool_response() function in test_log_to_messages.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  64af3cf9_5967_2889_29b0_351bffa0894a["test_custom_template_tool_response()"]
  022a381a_891e_110d_baf6_ddec630c8081["test_log_to_messages.py"]
  64af3cf9_5967_2889_29b0_351bffa0894a -->|defined in| 022a381a_891e_110d_baf6_ddec630c8081
  style 64af3cf9_5967_2889_29b0_351bffa0894a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/unit_tests/agents/format_scratchpad/test_log_to_messages.py lines 34–49

def test_custom_template_tool_response() -> None:
    intermediate_steps = [
        (AgentAction(tool="Tool1", tool_input="input1", log="Log1"), "Observation1"),
    ]
    template_tool_response = "Response: {observation}"
    expected_result = [
        AIMessage(content="Log1"),
        HumanMessage(content="Response: Observation1"),
    ]
    assert (
        format_log_to_messages(
            intermediate_steps,
            template_tool_response=template_tool_response,
        )
        == expected_result
    )

Domain

Subdomains

Frequently Asked Questions

What does test_custom_template_tool_response() do?
test_custom_template_tool_response() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/format_scratchpad/test_log_to_messages.py.
Where is test_custom_template_tool_response() defined?
test_custom_template_tool_response() is defined in libs/langchain/tests/unit_tests/agents/format_scratchpad/test_log_to_messages.py at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free