| import { Router } from "express"; | |
| import type express from "express"; | |
| import { handleChat, AVAILABLE_MODELS } from "../agent/chat.js"; | |
| import { handleEmbedChat } from "../agent/embed-chat.js"; | |
| export function createChatRouter(requireEditor: express.RequestHandler): Router { | |
| const router = Router(); | |
| router.get("/api/models", (_req, res) => res.json(AVAILABLE_MODELS)); | |
| router.post("/api/chat", requireEditor, handleChat); | |
| router.post("/api/embed-chat", requireEditor, handleEmbedChat); | |
| return router; | |
| } | |