Unverified Commit 835bf9fd authored by John Wang's avatar John Wang Committed by GitHub

fix: template parse error when pre prompt include {{}} (#462)

parent c720f831
......@@ -14,6 +14,7 @@ class JinjaPromptTemplate(PromptTemplate):
def from_template(cls, template: str, **kwargs: Any) -> PromptTemplate:
"""Load a prompt template from a template."""
env = Environment()
template = template.replace("{{}}", "{}")
ast = env.parse(template)
input_variables = meta.find_undeclared_variables(ast)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment