forked from Archives/langchain
dbbc340f25
`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) ``` |
||
---|---|---|
.. | ||
agents | ||
callbacks | ||
chains | ||
data | ||
docstore | ||
document_loader | ||
evaluation | ||
llms | ||
output_parsers | ||
prompts | ||
retrievers | ||
tools | ||
utilities | ||
__init__.py | ||
test_bash.py | ||
test_formatting.py | ||
test_python.py | ||
test_sql_database_schema.py | ||
test_sql_database.py | ||
test_text_splitter.py |