Initial commit

Creates an agent bot that reviews code to repositories that is has access to if it gets added as code reviewer

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Kalle Bracht
2026-05-02 10:44:51 +02:00
parent 195ee229b1
commit 3b4dcabe66
17 changed files with 513 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
import os
import google.genai as genai
class GeminiClient:
def __init__(self):
self.api_key = os.getenv("GOOGLE_API_KEY")
if not self.api_key:
raise RuntimeError("GOOGLE_API_KEY must be set")
# Google Developer AI model (configurable via env).
self.model = os.getenv("GOOGLE_MODEL", "gemini-2.5-pro")
self.client = genai.Client(api_key=self.api_key)
def generate_review(self, prompt: str) -> str:
"""Send prompt to Gemini and return the review."""
response = self.client.models.generate_content(
model=self.model,
contents=prompt
)
return response.text