From 556d1d03902a954cabf4a233c7dcd4dee1c54bb6 Mon Sep 17 00:00:00 2001 From: takatost Date: Sun, 4 Feb 2024 18:15:13 +0800 Subject: [PATCH] fix variable invalid when key only one character (#2377) --- api/core/prompt/prompt_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/prompt/prompt_template.py b/api/core/prompt/prompt_template.py index fbf09d2c64..32c5a791de 100644 --- a/api/core/prompt/prompt_template.py +++ b/api/core/prompt/prompt_template.py @@ -1,6 +1,6 @@ import re -REGEX = re.compile(r"\{\{([a-zA-Z_][a-zA-Z0-9_]{1,29}|#histories#|#query#|#context#)\}\}") +REGEX = re.compile(r"\{\{([a-zA-Z_][a-zA-Z0-9_]{0,29}|#histories#|#query#|#context#)\}\}") class PromptTemplateParser: