Merge remote-tracking branch 'origin/enhancment/markdown' into feature/github_tag_improve

This commit is contained in:
Ori Kotek
2023-07-06 12:59:25 +03:00
5 changed files with 20 additions and 5 deletions

View File

@ -64,6 +64,8 @@ class PRQuestions:
return response
def _prepare_pr_answer(self) -> str:
answer_str = f"Questions: {self.question_str}\n\n"
answer_str = f"Question: {self.question_str}\n\n"
answer_str += f"Answer: {self.prediction.strip()}\n\n"
if settings.config.verbosity_level >= 2:
logging.info(f"answer_str:\n{answer_str}")
return answer_str

View File

@ -81,6 +81,14 @@ class PRReviewer:
except json.decoder.JSONDecodeError:
logging.error("Unable to decode JSON response from AI")
data = {}
# reordering for nicer display
if 'PR Feedback' in data:
if 'Security concerns' in data['PR Feedback']:
val = data['PR Feedback']['Security concerns']
del data['PR Feedback']['Security concerns']
data['PR Analysis']['Security concerns'] = val
markdown_text = convert_to_markdown(data)
user = self.git_provider.get_user_id()
markdown_text += "\n### How to use\n"