This commit is contained in:
mrT23
2023-07-17 16:53:38 +03:00
parent ea27c63f13
commit 539edcad3c
3 changed files with 11 additions and 7 deletions

View File

@ -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"
},

View File

@ -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
}

View File

@ -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 = ""