Home / Function/ test_chat_prompt_template_from_messages() — langchain Function Reference

test_chat_prompt_template_from_messages() — langchain Function Reference

Architecture documentation for the test_chat_prompt_template_from_messages() function in test_chat.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  971d3167_415f_65ea_15ec_66d93e3d053f["test_chat_prompt_template_from_messages()"]
  00c8bbe0_a31c_1ac8_487a_bfd5a9d6b117["test_chat.py"]
  971d3167_415f_65ea_15ec_66d93e3d053f -->|defined in| 00c8bbe0_a31c_1ac8_487a_bfd5a9d6b117
  style 971d3167_415f_65ea_15ec_66d93e3d053f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_chat.py lines 225–237

def test_chat_prompt_template_from_messages(
    messages: list[BaseMessagePromptTemplate],
) -> None:
    """Test creating a chat prompt template from messages."""
    chat_prompt_template = ChatPromptTemplate.from_messages(messages)
    assert sorted(chat_prompt_template.input_variables) == sorted(
        [
            "context",
            "foo",
            "bar",
        ]
    )
    assert len(chat_prompt_template.messages) == 4

Domain

Subdomains

Frequently Asked Questions

What does test_chat_prompt_template_from_messages() do?
test_chat_prompt_template_from_messages() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_chat.py.
Where is test_chat_prompt_template_from_messages() defined?
test_chat_prompt_template_from_messages() is defined in libs/core/tests/unit_tests/prompts/test_chat.py at line 225.

Analyze Your Own Codebase

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

Try Supermodel Free