👨‍💻 fix: prompt schema

This commit is contained in:
Florian Hönicke
2023-04-20 15:22:54 +02:00
parent 042a4164ee
commit 42cb4fc143
2 changed files with 15 additions and 16 deletions

View File

@@ -24,7 +24,7 @@ class Generator:
self.test_description = test_description
def extract_content_from_result(self, plain_text, file_name, match_single_block=False):
pattern = fr"^\*\*{file_name}\*\*\n```(?:\w+\n)?([\s\S]*?)```"
pattern = fr"^\*\*{file_name}\*\*\n```(?:\w+\n)?([\s\S]*?)\n```" # the \n at the end makes sure that ``` within the generated code is not matched
match = re.search(pattern, plain_text, re.MULTILINE)
if match:
return match.group(1).strip()