Update agent.py
Browse files
agent.py
CHANGED
|
@@ -1330,4 +1330,71 @@ class RateLimiter:
|
|
| 1330 |
if len(self.reqs[uid]) >= limit: return True
|
| 1331 |
self.reqs[uid].append(now); return False
|
| 1332 |
|
| 1333 |
-
rate_limiter = RateLimiter()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1330 |
if len(self.reqs[uid]) >= limit: return True
|
| 1331 |
self.reqs[uid].append(now); return False
|
| 1332 |
|
| 1333 |
+
rate_limiter = RateLimiter()
|
| 1334 |
+
# ================================================================
|
| 1335 |
+
# COMPATIBILITY & EXPORTS for app.py
|
| 1336 |
+
# ================================================================
|
| 1337 |
+
|
| 1338 |
+
# Map engine to orchestrator
|
| 1339 |
+
# This allows app.py to call orchestrator.process()
|
| 1340 |
+
engine.process = engine.run
|
| 1341 |
+
orchestrator = engine
|
| 1342 |
+
|
| 1343 |
+
# Map tools list
|
| 1344 |
+
ALL_TOOLS_SCHEMA = ALL_TOOLS
|
| 1345 |
+
|
| 1346 |
+
# Dummy ImageProcessor (logic is handled inside tools/engine)
|
| 1347 |
+
class ImageProcessor:
|
| 1348 |
+
pass
|
| 1349 |
+
|
| 1350 |
+
# Agent definitions required by app.py
|
| 1351 |
+
AGENTS = {
|
| 1352 |
+
"director": {
|
| 1353 |
+
"name": "Director",
|
| 1354 |
+
"icon": "π¬",
|
| 1355 |
+
"prompt": "You are the project director. You coordinate tasks and decide which agent to use."
|
| 1356 |
+
},
|
| 1357 |
+
"coder": {
|
| 1358 |
+
"name": "Coder",
|
| 1359 |
+
"icon": "π»",
|
| 1360 |
+
"prompt": "You are an expert programmer. Write efficient, documented code."
|
| 1361 |
+
},
|
| 1362 |
+
"researcher": {
|
| 1363 |
+
"name": "Researcher",
|
| 1364 |
+
"icon": "π¬",
|
| 1365 |
+
"prompt": "You are a researcher. Search the web and synthesize information."
|
| 1366 |
+
},
|
| 1367 |
+
"sysadmin": {
|
| 1368 |
+
"name": "SysAdmin",
|
| 1369 |
+
"icon": "βοΈ",
|
| 1370 |
+
"prompt": "You are a system administrator. Manage files, processes, and server health."
|
| 1371 |
+
},
|
| 1372 |
+
"creative": {
|
| 1373 |
+
"name": "Creative",
|
| 1374 |
+
"icon": "π¨",
|
| 1375 |
+
"prompt": "You are a creative artist and writer."
|
| 1376 |
+
},
|
| 1377 |
+
"analyst": {
|
| 1378 |
+
"name": "Analyst",
|
| 1379 |
+
"icon": "π",
|
| 1380 |
+
"prompt": "You are a data analyst. Interpret data and metrics."
|
| 1381 |
+
},
|
| 1382 |
+
"security": {
|
| 1383 |
+
"name": "Security",
|
| 1384 |
+
"icon": "π‘οΈ",
|
| 1385 |
+
"prompt": "You are a security expert. Audit code and permissions."
|
| 1386 |
+
},
|
| 1387 |
+
"doctor": {
|
| 1388 |
+
"name": "Doctor",
|
| 1389 |
+
"icon": "π₯",
|
| 1390 |
+
"prompt": "You are the health monitor."
|
| 1391 |
+
},
|
| 1392 |
+
"file_manager": {
|
| 1393 |
+
"name": "FileManager",
|
| 1394 |
+
"icon": "π",
|
| 1395 |
+
"prompt": "Organize and manage the file system."
|
| 1396 |
+
}
|
| 1397 |
+
}
|
| 1398 |
+
|
| 1399 |
+
# Agent team list
|
| 1400 |
+
agent_team = list(AGENTS.values())
|