diff --git a/src/options/generate/generator.py b/src/options/generate/generator.py index 00f4a80..22fe0be 100644 --- a/src/options/generate/generator.py +++ b/src/options/generate/generator.py @@ -48,7 +48,7 @@ class Generator: def extract_content_from_result(self, plain_text, file_name, match_single_block=False, can_contain_code_block=True): optional_line_break = '\n' if can_contain_code_block else '' # the \n at the end makes sure that ``` within the generated code is not matched because it is not right before a line break - pattern = fr"\*?\*?{file_name}\*?\*?\n```(?:\w+\n)?([\s\S]*?){optional_line_break}```" + pattern = fr"^\*?\*?{file_name}\*?\*?\n```(?:\w+\n)?([\s\S]*?){optional_line_break}```" matches = re.findall(pattern, plain_text, re.MULTILINE) if matches: return matches[-1].strip() diff --git a/src/options/generate/templates_user.py b/src/options/generate/templates_user.py index c7412cc..9bb1f65 100644 --- a/src/options/generate/templates_user.py +++ b/src/options/generate/templates_user.py @@ -203,9 +203,9 @@ template_summarize_error = PromptTemplate.from_template( "{error}" Your task is to summarize the error message as compact and informative as possible \ while maintaining all information necessary to debug the core issue (100 words). +It should also provide some additional context regarding the specific file and line number where the error occurred. \ Note that you must not suggest a solution to the error. -Warnings are not worth mentioning. -Your response should be concise and informative, highlighting the core issue while omitting any warnings. It should also provide some additional context regarding the specific file and line number where the error occurred. The actual core error message should also be included.''' +Warnings are not worth mentioning.''' )