Spaces:
Paused
Paused
Download agent_zero_framework/python/api/chat_export.py from Oldmangrizzz/Agent-Node: direct link, hf CLI and curl.
- Browser
- Download file 557 Bytes
-
https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/api/chat_export.py
- Command line
-
hf download hf://spaces/Oldmangrizzz/Agent-Node/agent_zero_framework/python/api/chat_export.py
-
curl -L -o chat_export.py https://huggingface.co/spaces/Oldmangrizzz/Agent-Node/resolve/main/agent_zero_framework/python/api/chat_export.py
557 Bytes
| from python.helpers.api import ApiHandler, Input, Output, Request | |
| from python.helpers import persist_chat | |
| class ExportChat(ApiHandler): | |
| async def process(self, input: Input, request: Request) -> Output: | |
| ctxid = input.get("ctxid", "") | |
| if not ctxid: | |
| raise Exception("No context id provided") | |
| context = self.use_context(ctxid) | |
| content = persist_chat.export_json_chat(context) | |
| return { | |
| "message": "Chats exported.", | |
| "ctxid": context.id, | |
| "content": content, | |
| } |