Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,6 +83,8 @@ class BasicAgent:
|
|
| 83 |
for attempt in range(retries):
|
| 84 |
try:
|
| 85 |
resp = requests.post(GROQ_API_URL, headers=headers, json=payload, timeout=60)
|
|
|
|
|
|
|
| 86 |
resp.raise_for_status()
|
| 87 |
data = resp.json()
|
| 88 |
return data["choices"][0]["message"]["content"].strip()
|
|
@@ -425,4 +427,4 @@ if __name__ == "__main__":
|
|
| 425 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
| 426 |
|
| 427 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
| 428 |
-
demo.launch(debug=True, share=False)
|
|
|
|
| 83 |
for attempt in range(retries):
|
| 84 |
try:
|
| 85 |
resp = requests.post(GROQ_API_URL, headers=headers, json=payload, timeout=60)
|
| 86 |
+
if resp.status_code != 200:
|
| 87 |
+
print(f"Groq API returned status {resp.status_code}. Body: {resp.text[:1000]}")
|
| 88 |
resp.raise_for_status()
|
| 89 |
data = resp.json()
|
| 90 |
return data["choices"][0]["message"]["content"].strip()
|
|
|
|
| 427 |
print("-"*(60 + len(" App Starting ")) + "\n")
|
| 428 |
|
| 429 |
print("Launching Gradio Interface for Basic Agent Evaluation...")
|
| 430 |
+
demo.launch(debug=True, share=False)
|