This commit is contained in:
zhanglei 2024-08-13 16:53:16 +08:00
parent b36f34c144
commit e6ae39da57

View file

@ -164,7 +164,6 @@ class CodeReview(Action):
system_prompt = [CODE_REVIEW_COMFIRM_SYSTEM_PROMPT.format(code_language=code_language)]
resp = await self.llm.aask(prompt, system_msgs=system_prompt)
if "True" in resp or "true" in resp:
cmt["code"] = get_code_block_from_patch(patch, code_start_line, code_end_line)
new_comments.append(cmt)
except Exception:
logger.info("False")
@ -209,6 +208,6 @@ class CodeReview(Action):
comments = await self.confirm_comments(patch=patch, comments=comments, points=points)
for comment in comments:
if comment["code"]:
if not (comment["code"].startswith("-") or comment["code"].isspace()):
if not (comment["code"].isspace()):
result.append(comment)
return result