Home / Function/ test_prompt_from_jinja2_template_multiple_inputs_with_repeats() — langchain Function Reference

test_prompt_from_jinja2_template_multiple_inputs_with_repeats() — langchain Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_prompt.py lines 474–501

def test_prompt_from_jinja2_template_multiple_inputs_with_repeats() -> None:
    """Test with multiple input variables and repeats."""
    template = """\
Hello world

Your variable: {{ foo }}

{# This will not get rendered #}

{% if bar %}
You just set bar boolean variable to true
{% endif %}

{% for i in foo_list %}
{{ i }}
{% endfor %}

{% if bar %}
Your variable again: {{ foo }}
{% endif %}
"""
    prompt = PromptTemplate.from_template(template, template_format="jinja2")
    expected_prompt = PromptTemplate(
        template=template,
        input_variables=["bar", "foo", "foo_list"],
        template_format="jinja2",
    )
    assert prompt == expected_prompt

Subdomains

Frequently Asked Questions

What does test_prompt_from_jinja2_template_multiple_inputs_with_repeats() do?
test_prompt_from_jinja2_template_multiple_inputs_with_repeats() 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_multiple_inputs_with_repeats() defined?
test_prompt_from_jinja2_template_multiple_inputs_with_repeats() is defined in libs/core/tests/unit_tests/prompts/test_prompt.py at line 474.

Analyze Your Own Codebase

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

Try Supermodel Free