Spaces:
Paused
Paused
Download agent_zero_framework/python/api/chat_reset.py from Oldmangrizzz/Agent-Node: direct link, hf CLI and curl.
- Browser
- Download file 517 Bytes
-
https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/api/chat_reset.py
- Command line
-
hf download hf://spaces/Oldmangrizzz/Agent-Node/agent_zero_framework/python/api/chat_reset.py
-
curl -L -o chat_reset.py https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/api/chat_reset.py
517 Bytes
| from python.helpers.api import ApiHandler, Input, Output, Request | |
| from python.helpers import persist_chat | |
| class Reset(ApiHandler): | |
| async def process(self, input: Input, request: Request) -> Output: | |
| ctxid = input.get("context", "") | |
| # context instance - get or create | |
| context = self.use_context(ctxid) | |
| context.reset() | |
| persist_chat.save_tmp_chat(context) | |
| persist_chat.remove_msg_files(ctxid) | |
| return { | |
| "message": "Agent restarted.", | |
| } | |