test_prompt_jinja2_functionality() — langchain Function Reference
Architecture documentation for the test_prompt_jinja2_functionality() function in test_few_shot.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 56e79002_3049_97bd_5e7b_36be247a02e2["test_prompt_jinja2_functionality()"] e4e12a36_798e_ddc0_ab57_e44de269c7e7["test_few_shot.py"] 56e79002_3049_97bd_5e7b_36be247a02e2 -->|defined in| e4e12a36_798e_ddc0_ab57_e44de269c7e7 style 56e79002_3049_97bd_5e7b_36be247a02e2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/prompts/test_few_shot.py lines 237–256
def test_prompt_jinja2_functionality(
example_jinja2_prompt: tuple[PromptTemplate, list[dict[str, str]]],
) -> None:
prefix = "Starting with {{ foo }}"
suffix = "Ending with {{ bar }}"
prompt = FewShotPromptTemplate(
input_variables=["foo", "bar"],
suffix=suffix,
prefix=prefix,
examples=example_jinja2_prompt[1],
example_prompt=example_jinja2_prompt[0],
template_format="jinja2",
)
output = prompt.format(foo="hello", bar="bye")
expected_output = (
"Starting with hello\n\nhappy: sad\n\ntall: short\n\nEnding with bye"
)
assert output == expected_output
Domain
Subdomains
Source
Frequently Asked Questions
What does test_prompt_jinja2_functionality() do?
test_prompt_jinja2_functionality() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_few_shot.py.
Where is test_prompt_jinja2_functionality() defined?
test_prompt_jinja2_functionality() is defined in libs/core/tests/unit_tests/prompts/test_few_shot.py at line 237.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free