소스 검색

fix variable invalid when key only one character (#2377)

takatost 1 년 전
부모
커밋
556d1d0390
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      api/core/prompt/prompt_template.py

+ 1 - 1
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: