test_create_chat_prompt_template_from_template_partial() — langchain Function Reference
Architecture documentation for the test_create_chat_prompt_template_from_template_partial() function in test_chat.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 4e133c14_8d5c_e62b_4d13_77e0f75ca63b["test_create_chat_prompt_template_from_template_partial()"] bf3138ca_0068_68ea_f479_35376e264d13["test_chat.py"] 4e133c14_8d5c_e62b_4d13_77e0f75ca63b -->|defined in| bf3138ca_0068_68ea_f479_35376e264d13 style 4e133c14_8d5c_e62b_4d13_77e0f75ca63b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/prompts/test_chat.py lines 94–107
def test_create_chat_prompt_template_from_template_partial() -> None:
"""Create a chat prompt template with partials."""
prompt = ChatPromptTemplate.from_template(
"hi {foo} {bar}", partial_variables={"foo": "jim"}
)
expected_prompt = PromptTemplate(
template="hi {foo} {bar}",
input_variables=["bar"],
partial_variables={"foo": "jim"},
)
assert len(prompt.messages) == 1
output_prompt = prompt.messages[0]
assert isinstance(output_prompt, HumanMessagePromptTemplate)
assert output_prompt.prompt == expected_prompt
Domain
Subdomains
Source
Frequently Asked Questions
What does test_create_chat_prompt_template_from_template_partial() do?
test_create_chat_prompt_template_from_template_partial() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_chat.py.
Where is test_create_chat_prompt_template_from_template_partial() defined?
test_create_chat_prompt_template_from_template_partial() is defined in libs/core/tests/unit_tests/prompts/test_chat.py at line 94.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free