Spaces:
Runtime error
Runtime error
Update bot.py
Browse files
bot.py
CHANGED
|
@@ -139,8 +139,8 @@ class GeminiManager:
|
|
| 139 |
|
| 140 |
def report_dead_key(self, key):
|
| 141 |
with self.lock:
|
| 142 |
-
self.cooldowns[key] = time.time() +
|
| 143 |
-
print(f"
|
| 144 |
|
| 145 |
async def analyze_image(self, image_path, advance_mode=False):
|
| 146 |
prompt = """TASK: STRICT OCR ONLY (VISION + COMPLETENESS ENFORCED)
|
|
@@ -246,7 +246,7 @@ ORDER NO. 6: FINAL ENFORCEMENT (ZERO TOLERANCE)
|
|
| 246 |
for attempt in range(len(self.keys)):
|
| 247 |
current_api_key = self.get_valid_key()
|
| 248 |
if not current_api_key:
|
| 249 |
-
await asyncio.sleep(
|
| 250 |
continue
|
| 251 |
|
| 252 |
genai.configure(api_key=current_api_key)
|
|
|
|
| 139 |
|
| 140 |
def report_dead_key(self, key):
|
| 141 |
with self.lock:
|
| 142 |
+
self.cooldowns[key] = time.time() + 300
|
| 143 |
+
print(f" مفتاح تم حظره لمدة خمساية ن: {key[:10]}...")
|
| 144 |
|
| 145 |
async def analyze_image(self, image_path, advance_mode=False):
|
| 146 |
prompt = """TASK: STRICT OCR ONLY (VISION + COMPLETENESS ENFORCED)
|
|
|
|
| 246 |
for attempt in range(len(self.keys)):
|
| 247 |
current_api_key = self.get_valid_key()
|
| 248 |
if not current_api_key:
|
| 249 |
+
await asyncio.sleep(2)
|
| 250 |
continue
|
| 251 |
|
| 252 |
genai.configure(api_key=current_api_key)
|