fix: template parse error when pre prompt include {{}} (#462)
This commit is contained in:
parent
c720f831af
commit
835bf9fd8d
1 changed files with 1 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue