Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,10 +136,13 @@ Order from most to least impactful.
|
|
| 136 |
|
| 137 |
|
| 138 |
def analyze_repo(repo_url: str, github_token: str, groq_api_key: str, progress=gr.Progress()):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
if not repo_url.strip():
|
| 140 |
return "❌ **Error:** Please enter a GitHub repository URL."
|
| 141 |
|
| 142 |
-
# Env var takes priority (HF Secret), then UI input
|
| 143 |
api_key = os.environ.get("GROQ_API_KEY") or groq_api_key.strip()
|
| 144 |
if not api_key:
|
| 145 |
return "❌ **Error:** Please enter your Groq API key (free at [console.groq.com](https://console.groq.com))."
|
|
|
|
| 136 |
|
| 137 |
|
| 138 |
def analyze_repo(repo_url: str, github_token: str, groq_api_key: str, progress=gr.Progress()):
|
| 139 |
+
repo_url = repo_url or ""
|
| 140 |
+
github_token = github_token or ""
|
| 141 |
+
groq_api_key = groq_api_key or ""
|
| 142 |
+
|
| 143 |
if not repo_url.strip():
|
| 144 |
return "❌ **Error:** Please enter a GitHub repository URL."
|
| 145 |
|
|
|
|
| 146 |
api_key = os.environ.get("GROQ_API_KEY") or groq_api_key.strip()
|
| 147 |
if not api_key:
|
| 148 |
return "❌ **Error:** Please enter your Groq API key (free at [console.groq.com](https://console.groq.com))."
|