Explorar el Código

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

tags/0.3.6
John Wang hace 2 años
padre
commit
835bf9fd8d
No account linked to committer's email address
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1
    0
      api/core/prompt/prompt_template.py

+ 1
- 0
api/core/prompt/prompt_template.py Ver fichero

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


Cargando…
Cancelar
Guardar