main
py 23 lines 621 Bytes
Raw
1 from helpers.api import ApiHandler, Input, Output, Request
2 from helpers import subagents
3
4
5 class Agents(ApiHandler):
6 async def process(self, input: Input, request: Request) -> Output:
7 action = input.get("action", "")
8
9 try:
10 if action == "list":
11 data = subagents.get_all_agents_list()
12 else:
13 raise Exception("Invalid action")
14
15 return {
16 "ok": True,
17 "data": data,
18 }
19 except Exception as e:
20 return {
21 "ok": False,
22 "error": str(e),
23 }