Massive Improvements & MVP Patches
This commit is contained in:
@@ -124,7 +124,8 @@ def _build_prompt(
|
||||
' "verdict": "correct" | "has_issues",\n'
|
||||
' "confidence": 0.0,\n'
|
||||
' "summary": "...",\n'
|
||||
' "findings": [{"severity":"low|medium|high|critical","file":"...","line_start":1,"line_end":1,"title":"...","body":"...","suggestion":"..."}]\n'
|
||||
' "findings": [{"severity":"low|medium|high|critical","file":"...","line_start":1,"line_end":1,"title":"...","body":"...","suggestion":"..."}],\n'
|
||||
' "markdown_comment": "Full markdown comment body to post to Gitea. Include clear section breaks and blank lines."\n'
|
||||
"}\n\n"
|
||||
f"PR URL: {pr.html_url}\n"
|
||||
f"Mode: {mode}\n"
|
||||
@@ -138,8 +139,11 @@ def _build_prompt(
|
||||
|
||||
|
||||
def _call_openai_review(settings: Settings, prompt: str) -> dict[str, Any]:
|
||||
api_key = settings.openai_api_key.get_secret_value() if settings.openai_api_key else ""
|
||||
if not api_key.strip():
|
||||
raise ReviewError("OPENAI_API_KEY is required for API-key review mode.")
|
||||
headers: dict[str, str] = {
|
||||
"Authorization": f"Bearer {settings.openai_api_key.get_secret_value()}",
|
||||
"Authorization": f"Bearer {api_key}",
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
if settings.openai_org_id:
|
||||
|
||||
Reference in New Issue
Block a user