import type { contextObject } from "src/page-contexts/pages/types/context-object"; import type { Message } from "../types/dialogue-message"; import { api } from "src/boot/axios"; export const chatbotService = { // Function to get the message from the backend getChatMessage: async (userInput: string): Promise => { const response = await api.post("/chat/respond", { userInput }); return response.data as Message; }, sendUrl: async (url: string): Promise => { const response = await api.post("/chat/page-url", { url }); return response.data; }, sendPageContext: async (context: contextObject): Promise => { const response = await api.post("/chat/context", context); return response.data; }, };