Skip to content

Commit 99997bc

Browse files
author
siquanlv
committed
ai review test
1 parent 8ee9a8f commit 99997bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/scripts/ai_code_review.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ def load_diff(file_path='pr.diff'):
1212

1313
def call_gpt(diff_text):
1414
"""Call AI to review the diff."""
15+
api_key = os.getenv("OPENAI_API_KEY")
16+
if not api_key:
17+
raise ValueError("❌ OPENAI_API_KEY is not set.")
18+
1519
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")})
1620

1721
prompt = f"""

0 commit comments

Comments
 (0)