mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-30 20:50:21 +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,21 +0,0 @@
|
|||
from agent import AgentContext, UserMessage
|
||||
from helpers.api import ApiHandler, Input, Output, Request, Response
|
||||
|
||||
|
||||
class PluginScanStart(ApiHandler):
|
||||
"""Start the agent on a context whose user message was already logged by the queue API."""
|
||||
|
||||
async def process(self, input: Input, request: Request) -> Output:
|
||||
ctxid: str = input.get("context", "")
|
||||
text: str = input.get("text", "")
|
||||
|
||||
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)
|
||||
|
||||
context.communicate(UserMessage(text, []))
|
||||
|
||||
return {"ok": True, "context": ctxid}
|
||||
Loading…
Add table
Add a link
Reference in a new issue