import { Component, ControllerParams, global} from "qcobjects"; import { ChatbotController } from "../controllers/com.qcobjects.ui.controllers.openai"; export class ChatBotComponent extends Component { tplsource = "inline"; shadowed = true; template = `
⬇️
QCObjects OpenAI Chatbot
`; } export const chatbotComponent = new ChatBotComponent({name:"chatbot"}); export function sendMessage() { chatbotComponent.controller = new ChatbotController({component:chatbotComponent} as ControllerParams); const chatbot = chatbotComponent.controller as ChatbotController; chatbot.sendMessage(); } export function closeChatbot() { chatbotComponent.controller = new ChatbotController({component:chatbotComponent} as ControllerParams); const chatbot = chatbotComponent.controller as ChatbotController; chatbot.closeChat(); } global.set("chatbotSendMessage", sendMessage); global.set("closeChatbot", closeChatbot);