Spaces:
Sleeping
Sleeping
Rename aiagent.py to agent.py
Browse files- aiagent.py → agent.py +2 -2
aiagent.py → agent.py
RENAMED
|
@@ -60,7 +60,7 @@ class MistralClient:
|
|
| 60 |
response = requests.post(url, headers=headers, json=data)
|
| 61 |
|
| 62 |
if response.status_code == 429:
|
| 63 |
-
print(f"[429]
|
| 64 |
time.sleep(backoff)
|
| 65 |
backoff *= 2
|
| 66 |
continue
|
|
@@ -72,7 +72,7 @@ class MistralClient:
|
|
| 72 |
print(f"[ERREUR] HTTP {response.status_code}: {e}")
|
| 73 |
raise e
|
| 74 |
|
| 75 |
-
raise RuntimeError(f"
|
| 76 |
|
| 77 |
|
| 78 |
|
|
|
|
| 60 |
response = requests.post(url, headers=headers, json=data)
|
| 61 |
|
| 62 |
if response.status_code == 429:
|
| 63 |
+
print(f"[429] Too many requests - attempt {attempt}/{retries}, please wait {backoff}s...")
|
| 64 |
time.sleep(backoff)
|
| 65 |
backoff *= 2
|
| 66 |
continue
|
|
|
|
| 72 |
print(f"[ERREUR] HTTP {response.status_code}: {e}")
|
| 73 |
raise e
|
| 74 |
|
| 75 |
+
raise RuntimeError(f"Failed {retries} attempts (429 of errors)")
|
| 76 |
|
| 77 |
|
| 78 |
|