test_prompt_from_template_with_partial_variables() — langchain Function Reference
Architecture documentation for the test_prompt_from_template_with_partial_variables() function in test_prompt.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 240dee67_d2ac_9d27_9827_56ed6c6b3518["test_prompt_from_template_with_partial_variables()"] af1b998b_a7bf_9d5c_32ef_bab507a6bee3["test_prompt.py"] 240dee67_d2ac_9d27_9827_56ed6c6b3518 -->|defined in| af1b998b_a7bf_9d5c_32ef_bab507a6bee3 style 240dee67_d2ac_9d27_9827_56ed6c6b3518 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/prompts/test_prompt.py lines 248–261
def test_prompt_from_template_with_partial_variables() -> None:
"""Test prompts can be constructed from a template with partial variables."""
# given
template = "This is a {foo} test {bar}."
partial_variables = {"bar": "baz"}
# when
prompt = PromptTemplate.from_template(template, partial_variables=partial_variables)
# then
expected_prompt = PromptTemplate(
template=template,
input_variables=["foo"],
partial_variables=partial_variables,
)
assert prompt == expected_prompt
Domain
Subdomains
Source
Frequently Asked Questions
What does test_prompt_from_template_with_partial_variables() do?
test_prompt_from_template_with_partial_variables() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_prompt.py.
Where is test_prompt_from_template_with_partial_variables() defined?
test_prompt_from_template_with_partial_variables() is defined in libs/core/tests/unit_tests/prompts/test_prompt.py at line 248.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free