File size: 467 Bytes
67b6ab0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from helpers.api import ApiHandler, Input, Output, Request, Response
from helpers import persist_chat
class LoadChats(ApiHandler):
async def process(self, input: Input, request: Request) -> Output:
chats = input.get("chats", [])
if not chats:
raise Exception("No chats provided")
ctxids = persist_chat.load_json_chats(chats)
return {
"message": "Chats loaded.",
"ctxids": ctxids,
}
|