add 'py' suffix to rm_patch_useless_part

This commit is contained in:
shenchucheng 2024-06-28 11:03:36 +08:00
parent 68d5e945f6
commit dda10a6925
2 changed files with 1 additions and 3 deletions

View file

@ -71,8 +71,6 @@ class ModifyCode(Action):
)
# 代码增加上下文,提升代码修复的准确率
comment["code"] = code
if comment["point_id"] in [24, 25, 26]:
comment["point_detail"] = comment["point_detail"] + "\n" + comment["comment"]
# 去掉CR时LLM给的comment的影响应该使用既定的修复方案
comment.pop("comment")

View file

@ -5,7 +5,7 @@ from unidiff import Hunk, PatchedFile, PatchSet
from metagpt.logs import logger
def rm_patch_useless_part(patch: PatchSet, used_suffix: list[str] = ["java"]) -> PatchSet:
def rm_patch_useless_part(patch: PatchSet, used_suffix: list[str] = ["java", "py"]) -> PatchSet:
new_patch = PatchSet("")
useless_files = []
for pfile in patch: