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