Skip to content

Commit 8ee9a8f

Browse files
author
siquanlv
committed
ai review test
1 parent 6ca8703 commit 8ee9a8f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/scripts/ai_code_review.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def load_diff(file_path='pr.diff'):
1111
return f.read()
1212

1313
def call_gpt(diff_text):
14-
"""Call OpenAI GPT-4 to review the diff."""
15-
client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY"), base_url='https://llm-proxy.us-east-2.int.infra.intelligence.webex.com/azure/v1',default_headers={"api-key": os.getenv("OPENAI_API_KEY")})
14+
"""Call AI to review the diff."""
15+
client = openai.OpenAI(api_key=os.getenv("OPENAI_API_KEY"), base_url='https://llm-proxy.us-east-2.int.infra.intelligence.webex.com/azure/v1?api-version=2024-10-21',default_headers={"api-key": os.getenv("OPENAI_API_KEY")})
1616

1717
prompt = f"""
1818
You are a senior Java code reviewer.
@@ -43,9 +43,9 @@ def call_gpt(diff_text):
4343
```
4444
"""
4545

46-
print("🚀 Sending diff to GPT-4 for review...")
46+
print("🚀 Sending diff to AI for review...")
4747
response = client.chat.completions.create(
48-
model="2024-10-21",
48+
model="gpt-4o",
4949
messages=[
5050
{"role": "system", "content": "You are a Java code review expert."},
5151
{"role": "user", "content": prompt}

0 commit comments

Comments
 (0)