mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-29 12:10:57 +00:00
refactor - plugin names and builtin plugins
This commit is contained in:
parent
f0946138be
commit
6515626242
133 changed files with 1327 additions and 743 deletions
|
|
@ -1,26 +0,0 @@
|
|||
from agent import AgentContext
|
||||
from helpers.api import ApiHandler, Input, Output, Request, Response
|
||||
from helpers import message_queue as mq
|
||||
|
||||
|
||||
class PluginScanQueue(ApiHandler):
|
||||
"""Log the scan prompt into a chat. Optionally set progress to 'Queued'."""
|
||||
|
||||
async def process(self, input: Input, request: Request) -> Output:
|
||||
ctxid: str = input.get("context", "")
|
||||
text: str = input.get("text", "")
|
||||
queued: bool = input.get("queued", False)
|
||||
|
||||
if not ctxid or not text:
|
||||
return Response("Missing 'context' or 'text'.", 400)
|
||||
|
||||
context = AgentContext.get(ctxid)
|
||||
if context is None:
|
||||
return Response(f"Context {ctxid} not found.", 404)
|
||||
|
||||
mq.log_user_message(context, text, [])
|
||||
|
||||
if queued:
|
||||
context.log.set_progress("icon://hourglass_empty Queued - waiting for another scan to finish", 0, True)
|
||||
|
||||
return {"ok": True, "context": ctxid}
|
||||
Loading…
Add table
Add a link
Reference in a new issue