From 7dbb4ef09978735c301dfcf942d6677e92e35f32 Mon Sep 17 00:00:00 2001 From: PierreGode Date: Tue, 10 Dec 2024 15:34:20 +0100 Subject: [PATCH] Update review.yml --- .github/workflows/review.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index 2ab17e9..3a9d620 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -64,13 +64,23 @@ jobs: patch = fdata.get('patch', '') # Call OpenAI for inline code analysis - issues_prompt = f"""Analyze the following code changes for syntax errors, typos, and critical issues. Provide comments for specific errors with the line number where they occur: - \n\n{patch}""" + issues_prompt = f""" + Review the following code patch for errors and issues such as: + - Syntax errors + - Logical errors + - Typos or misconfigurations + Provide specific inline comments that include: + - The exact line number + - A clear explanation of the issue + - A suggested fix (if possible) + Patch to analyze: + {patch} + """ ai_headers = {"Content-Type": "application/json", "Authorization": f"Bearer {openai_key}"} data_issues = { "model": "gpt-4o-mini", "messages": [{"role": "user", "content": issues_prompt}], - "temperature": 0.7 + "temperature": 0.5 } issues_response = requests.post("https://api.openai.com/v1/chat/completions", headers=ai_headers, json=data_issues) issues_response.raise_for_status()