소스 검색

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

tags/0.3.6
John Wang 2 년 전
부모
커밋
835bf9fd8d
No account linked to committer's email address
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1
    0
      api/core/prompt/prompt_template.py

+ 1
- 0
api/core/prompt/prompt_template.py 파일 보기

@@ -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…
취소
저장