mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-03 14:10:32 +00:00
BIG PYTHON REFACTOR
Python scripts moved out of python/ folder to root to be unified with plugins + frontend extension around api calls
This commit is contained in:
parent
f94b7d742c
commit
d02dda3667
326 changed files with 1096 additions and 862 deletions
|
|
@ -1,18 +0,0 @@
|
|||
from python.helpers.api import ApiHandler, Request, Response
|
||||
from python.helpers import message_queue as mq
|
||||
from agent import AgentContext
|
||||
from python.helpers.state_monitor_integration import mark_dirty_for_context
|
||||
|
||||
class MessageQueueRemove(ApiHandler):
|
||||
"""Remove message(s) from queue."""
|
||||
|
||||
async def process(self, input: dict, request: Request) -> dict | Response:
|
||||
context = AgentContext.get(input.get("context", ""))
|
||||
if not context:
|
||||
return Response("Context not found", status=404)
|
||||
|
||||
item_id = input.get("item_id") # None means clear all
|
||||
remaining = mq.remove(context, item_id)
|
||||
mark_dirty_for_context(context.id, reason="message_queue_remove")
|
||||
|
||||
return {"ok": True, "remaining": remaining}
|
||||
Loading…
Add table
Add a link
Reference in a new issue