2026-07-28 15:00:29 +07:00
|
|
|
import express, { type Router } from "express";
|
|
|
|
|
import { validateBody } from "../../shared/middlewares/index.js";
|
|
|
|
|
import {
|
|
|
|
|
clearChatbotHistory,
|
|
|
|
|
getChatbotHistory,
|
|
|
|
|
handleChatbotChat,
|
|
|
|
|
} from "./chatbot.controller.js";
|
|
|
|
|
import { chatRequestSchema } from "./chatbot.schema.js";
|
|
|
|
|
|
|
|
|
|
export function createChatbotRouter(): Router {
|
|
|
|
|
const router = express.Router();
|
|
|
|
|
|
2026-08-01 22:09:02 +07:00
|
|
|
router.post("/chat", validateBody(chatRequestSchema), handleChatbotChat);
|
2026-07-28 15:00:29 +07:00
|
|
|
router.get("/chat/history", getChatbotHistory);
|
|
|
|
|
router.delete("/chat/history", clearChatbotHistory);
|
|
|
|
|
|
|
|
|
|
return router;
|
|
|
|
|
}
|