Home / Function/ test_prompt_from_jinja2_template() — langchain Function Reference

test_prompt_from_jinja2_template() — langchain Function Reference

Architecture documentation for the test_prompt_from_jinja2_template() function in test_prompt.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c7374a0e_6ac8_0822_5b6a_690ce787f166["test_prompt_from_jinja2_template()"]
  af1b998b_a7bf_9d5c_32ef_bab507a6bee3["test_prompt.py"]
  c7374a0e_6ac8_0822_5b6a_690ce787f166 -->|defined in| af1b998b_a7bf_9d5c_32ef_bab507a6bee3
  style c7374a0e_6ac8_0822_5b6a_690ce787f166 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_prompt.py lines 421–432

def test_prompt_from_jinja2_template() -> None:
    """Test prompts can be constructed from a jinja2 template."""
    # Empty input variable.
    template = """Hello there
There is no variable here {
Will it get confused{ }?
    """
    prompt = PromptTemplate.from_template(template, template_format="jinja2")
    expected_prompt = PromptTemplate(
        template=template, input_variables=[], template_format="jinja2"
    )
    assert prompt == expected_prompt

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free