Files
GMW/services/frontend/src/lib/api/chatbot.ts
T

15 lines
411 B
TypeScript
Raw Normal View History

import type { ChatbotHistoryRow, ChatbotResponse } from "@/lib/types";
import { api } from "./client";
export const chatbotApi = {
send: (message: string) =>
api.post<ChatbotResponse>("/api/chat", { message }),
getHistory: () =>
api.get<{ history: ChatbotHistoryRow[]; total: number }>(
"/api/chat/history",
),
clearHistory: () => api.delete<{ ok: boolean }>("/api/chat/history"),
};