14 lines
394 B
TypeScript
14 lines
394 B
TypeScript
// composables/chat-api.ts
|
|
import { useChatbotStore } from "src/stores/chatbot-store";
|
|
import type { Message } from "src/modules/chatbot/models/dialogue-message.model";
|
|
|
|
export const useChatbotApi = () => {
|
|
const chatStore = useChatbotStore();
|
|
|
|
const sendMessage = async (text: string): Promise<Message> => {
|
|
return await chatStore.sendMessage(text);
|
|
};
|
|
|
|
return { sendMessage };
|
|
};
|