forked from Archives/langchain
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
`langchain.prompts.PromptTemplate` and `langchain.prompts.FewShotPromptTemplate` do not validate `input_variables` when initialized as `jinja2` template. ```python # Using langchain v0.0.144 template = """"\ Your variable: {{ foo }} {% if bar %} You just set bar boolean variable to true {% endif %} """ # Missing variable, should raise ValueError prompt_template = PromptTemplate(template=template, input_variables=["bar"], template_format="jinja2", validate_template=True) # Extra variable, should raise ValueError prompt_template = PromptTemplate(template=template, input_variables=["bar", "foo", "extra", "thing"], template_format="jinja2", validate_template=True) ``` |
1 year ago | |
---|---|---|
.. | ||
__init__.py | 2 years ago | |
test_chat.py | 2 years ago | |
test_few_shot.py | 1 year ago | |
test_few_shot_with_templates.py | 2 years ago | |
test_length_based_example_selector.py | 2 years ago | |
test_loading.py | 1 year ago | |
test_prompt.py | 1 year ago | |
test_utils.py | 2 years ago |