Unverified Commit 7f48fadd authored by John Wang's avatar John Wang Committed by GitHub

fix: prompt template parantheses select error (#244)

parent af2138e8
...@@ -32,6 +32,6 @@ class PromptBuilder: ...@@ -32,6 +32,6 @@ class PromptBuilder:
@classmethod @classmethod
def process_template(cls, template: str): def process_template(cls, template: str):
processed_template = re.sub(r'\{(.+?)\}', r'\1', template) processed_template = re.sub(r'\{([a-zA-Z_]\w+?)\}', r'\1', template)
processed_template = re.sub(r'\{\{(.+?)\}\}', r'{\1}', processed_template) processed_template = re.sub(r'\{\{([a-zA-Z_]\w+?)\}\}', r'{\1}', processed_template)
return processed_template return processed_template
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment