From dc86d0307a3ac6b946e908d0d25772719638dcdb Mon Sep 17 00:00:00 2001 From: KOSASIH Date: Fri, 12 Jul 2024 18:57:06 +0700 Subject: [PATCH] Create nexus_aipowered_chatbot.js --- .../src/components/nexus_aipowered_chatbot.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 nexus_banking_networks/nexus_web/src/components/nexus_aipowered_chatbot.js diff --git a/nexus_banking_networks/nexus_web/src/components/nexus_aipowered_chatbot.js b/nexus_banking_networks/nexus_web/src/components/nexus_aipowered_chatbot.js new file mode 100644 index 000000000..e42275a34 --- /dev/null +++ b/nexus_banking_networks/nexus_web/src/components/nexus_aipowered_chatbot.js @@ -0,0 +1,17 @@ +import { Chatbot } from 'rivescript'; + +class NexusAIPoweredChatbot { + constructor() { + this.bot = new Chatbot(); + this.bot.load('nexus_chatbot.rive'); + } + + respond(input) { + return this.bot.reply('localuser', input); + } +} + +const chatbot = new NexusAIPoweredChatbot(); + +// Example usage: +console.log(chatbot.respond('Hello, how are you?'));