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