diff --git a/pr_agent/settings/pr_reviewer_prompts.toml b/pr_agent/settings/pr_reviewer_prompts.toml index 99e00e6b..3a8f0b51 100644 --- a/pr_agent/settings/pr_reviewer_prompts.toml +++ b/pr_agent/settings/pr_reviewer_prompts.toml @@ -24,7 +24,7 @@ You must use the following JSON schema to format your answer: }, {%- endif %} {%- if question_str %} - "Insights from user's answers": { + "Insights from user's answer": { "type": "string", "description": "shortly summarize the insights you gained from the user's answers to the questions" }, diff --git a/pr_agent/tools/pr_information_from_user.py b/pr_agent/tools/pr_information_from_user.py index 8e5a5d98..adfd9733 100644 --- a/pr_agent/tools/pr_information_from_user.py +++ b/pr_agent/tools/pr_information_from_user.py @@ -21,7 +21,7 @@ class PRInformationFromUser: self.vars = { "title": self.git_provider.pr.title, "branch": self.git_provider.get_pr_branch(), - "description": self.git_provider.get_description(), + "description": self.git_provider.get_pr_description(), "language": self.main_pr_language, "diff": "", # empty diff for initial calculation } diff --git a/pr_agent/tools/pr_reviewer.py b/pr_agent/tools/pr_reviewer.py index c6e9d9ff..a05aaac1 100644 --- a/pr_agent/tools/pr_reviewer.py +++ b/pr_agent/tools/pr_reviewer.py @@ -118,12 +118,16 @@ class PRReviewer: except json.decoder.JSONDecodeError: data = try_fix_json(review) - for d in data['PR Feedback']['Code suggestions']: - relevant_file = d['relevant file'].strip() - relevant_line_in_file = d['relevant line in file'].strip() - content = d['suggestion content'] + if settings.config.pr_reviewer > 0: + try: + for d in data['PR Feedback']['Code suggestions']: + relevant_file = d['relevant file'].strip() + relevant_line_in_file = d['relevant line in file'].strip() + content = d['suggestion content'] - self.git_provider.publish_inline_comment(content, relevant_file, relevant_line_in_file) + self.git_provider.publish_inline_comment(content, relevant_file, relevant_line_in_file) + except KeyError: + pass def _get_user_answers(self): answer_str = question_str = ""