Home / Function/ test_structured_prompt_template_format() — langchain Function Reference

test_structured_prompt_template_format() — langchain Function Reference

Architecture documentation for the test_structured_prompt_template_format() function in test_structured.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  5461017f_1832_20a0_c87f_7c7f7a2b6f32["test_structured_prompt_template_format()"]
  3513030b_4904_ecfd_7a0d_cc92be4dda69["test_structured.py"]
  5461017f_1832_20a0_c87f_7c7f7a2b6f32 -->|defined in| 3513030b_4904_ecfd_7a0d_cc92be4dda69
  style 5461017f_1832_20a0_c87f_7c7f7a2b6f32 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_structured.py lines 124–134

def test_structured_prompt_template_format() -> None:
    prompt = StructuredPrompt(
        [("human", "hi {{person.name}}")],
        schema={"type": "object", "properties": {}, "title": "foo"},
        template_format="mustache",
    )
    assert prompt.messages[0].prompt.template_format == "mustache"  # type: ignore[union-attr, union-attr]
    assert prompt.input_variables == ["person"]
    assert prompt.invoke({"person": {"name": "foo"}}).to_messages() == [
        HumanMessage("hi foo")
    ]

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free