mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
19febc77d6
`langchain.prompts.PromptTemplate` is unable to infer `input_variables` from jinja2 template. ```python # Using langchain v0.0.141 template_string = """\ Hello world Your variable: {{ var }} {# This will not get rendered #} {% if verbose %} Congrats! You just turned on verbose mode and got extra messages! {% endif %} """ template = PromptTemplate.from_template(template_string, template_format="jinja2") print(template.input_variables) # Output ['# This will not get rendered #', '% endif %', '% if verbose %'] ``` --------- Co-authored-by: engkheng <ongengkheng929@example.com> |
||
---|---|---|
.. | ||
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 |