Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

John Wang835bf9fd8d65
diff --git a/api/core/prompt/prompt_template.py b/api/core/prompt/prompt_template.py
index 43373897865..c51c4700c1c 100644
--- a/api/core/prompt/prompt_template.py
+++ b/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)