mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-01 21:20:33 +00:00
API separation
This commit is contained in:
parent
8db8d3fa18
commit
c0947e30c7
28 changed files with 683 additions and 770 deletions
18
python/api/chat_remove.py
Normal file
18
python/api/chat_remove.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
from python.helpers.api import ApiHandler
|
||||
from flask import Request, Response
|
||||
|
||||
from agent import AgentContext
|
||||
from python.helpers import persist_chat
|
||||
|
||||
|
||||
class RemoveChat(ApiHandler):
|
||||
async def process(self, input: dict, request: Request) -> dict | Response:
|
||||
ctxid = input.get("context", "")
|
||||
|
||||
# context instance - get or create
|
||||
AgentContext.remove(ctxid)
|
||||
persist_chat.remove_chat(ctxid)
|
||||
|
||||
return {
|
||||
"message": "Context removed.",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue