Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def call_groq_api(prompt, model="llama3-70b-8192"):
|
|
| 31 |
return f"[Groq API Error] {response.text}"
|
| 32 |
|
| 33 |
def call_blackbox_agent(prompt):
|
| 34 |
-
url = "https://api.
|
| 35 |
headers = {
|
| 36 |
"Content-Type": "application/json",
|
| 37 |
"Authorization": f"Bearer {BLACKBOX_API_KEY}"
|
|
@@ -42,8 +42,8 @@ def call_blackbox_agent(prompt):
|
|
| 42 |
response = requests.post(url, headers=headers, json=data)
|
| 43 |
if response.status_code == 200:
|
| 44 |
return response.json().get("response", response.json())
|
| 45 |
-
else:
|
| 46 |
-
|
| 47 |
|
| 48 |
# --- UTILS ---
|
| 49 |
def code_matches_language(code, language):
|
|
|
|
| 31 |
return f"[Groq API Error] {response.text}"
|
| 32 |
|
| 33 |
def call_blackbox_agent(prompt):
|
| 34 |
+
url = "https://api.code.blackbox.ai/v1/chat/completions"
|
| 35 |
headers = {
|
| 36 |
"Content-Type": "application/json",
|
| 37 |
"Authorization": f"Bearer {BLACKBOX_API_KEY}"
|
|
|
|
| 42 |
response = requests.post(url, headers=headers, json=data)
|
| 43 |
if response.status_code == 200:
|
| 44 |
return response.json().get("response", response.json())
|
| 45 |
+
#else:
|
| 46 |
+
# return call_groq_api(prompt)
|
| 47 |
|
| 48 |
# --- UTILS ---
|
| 49 |
def code_matches_language(code, language):
|