natabrizy commited on
Commit
b413741
·
verified ·
1 Parent(s): 8131ecd

Rename aiagent.py to agent.py

Browse files
Files changed (1) hide show
  1. 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] Trop de requêtes - tentative {attempt}/{retries}, attente {backoff}s...")
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"Échec après {retries} tentatives (429 ou autres erreurs)")
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