Przeglądaj źródła

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

tags/0.3.6
John Wang 2 lat temu
rodzic
commit
835bf9fd8d
No account linked to committer's email address
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1
    0
      api/core/prompt/prompt_template.py

+ 1
- 0
api/core/prompt/prompt_template.py Wyświetl plik

@@ -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)


Ładowanie…
Anuluj
Zapisz