import type { ChatbotPageContext } from "src/modules/chatbot/models/page-context.model";
import type { Message } from "src/modules/chatbot/models/dialogue-message.model";
import { api } from "src/boot/axios";

export const chatbotService = {
    // Function to send the message to the backend
    sendChatMessage: async (userInput: string, pageContext: ChatbotPageContext | undefined): Promise<Message> => {
        const response = await api.post("/chatbot", { userInput, pageContext });
        return response.data as Message;
    },

    // // Function to send context to backend
    // sendPageContext: async (context: chatbotPageContext): Promise<string> => {
    //     const response = await api.post("/chatbot/context", context);
    //     return response.data;
    // },

    // // Function to send user credentials to the backend to communicate with n8n.
    // sendUserCredentials: async (email: string, role: string): Promise<boolean> => {
    //     const response = await api.post("/chatbot/user", { email, role });
    //     return response.data;
    // },

    // retrieveCustomerDiagnostics: async (id: string): Promise<string> => {
    //     const response = await api.get(`/chat/customer/${id}`);
    //     return response.data;
    // },
};
