{"_id":"@alikjs/chatbot","_rev":"5-9f49db296fd8946110939ee7a8e2199d","time":{"created":"2023-12-28T07:11:45.699Z","1.0.0":"2023-12-28T06:15:15.585Z","modified":"2023-12-28T07:32:18.201Z","1.0.0-dev":"2023-12-28T06:26:33.430Z","1.0.1":"2023-12-28T07:11:46.006Z","1.0.1-test":"2023-12-28T07:32:18.004Z"},"name":"@alikjs/chatbot","dist-tags":{"latest":"1.0.1-test"},"versions":{"1.0.1":{"name":"@alikjs/chatbot","version":"1.0.1","description":"Chatbot module using OpenAI","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","start":"node dist/index.js","test":"jest"},"keywords":["chatbot","openai","ai","npm"],"author":{"name":"Alik"},"license":"MIT","dependencies":{"axios":"^1.6.3","openai":"^4.24.1"},"devDependencies":{"@types/jest":"^29.5.11","@types/mocha":"^10.0.6","@types/node":"^16.11.16","jest":"^27.5.1","typescript":"^4.5.4"},"gitHead":"94b309f8e93b0a47a748c8a65f9b20e3a682e31a","_id":"@alikjs/chatbot@1.0.1","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-LNG+TyJHcpW3Fp+NEKQiIlk9pXwpitHGU9HJR7FD+Z1k10i1kVDmtTM2bB1Rtv6vfrQUoWbn2VMdr6ZpdTbbGA==","shasum":"e458cc12ec8e2297c90dd0117ec0f65c527f6d5c","tarball":"https://registry.npmjs.org/@alikjs/chatbot/-/chatbot-1.0.1.tgz","fileCount":18,"unpackedSize":25088,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE6H/sCQ/5VOy8lMGmJGP49pZ0qyhcUPdEiQkxMwti9BAiEAvZ/QVnO3fiUhufwQHlHz96klxIAIXp5o5akdGIAQMPo="}]},"_npmUser":{"name":"contributortymara","email":"ujumen1827@gmail.com"},"directories":{},"maintainers":[{"name":"contributortymara","email":"ujumen1827@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chatbot_1.0.1_1703747505820_0.019227412882036887"},"_hasShrinkwrap":false},"1.0.1-test":{"name":"@alikjs/chatbot","version":"1.0.1-test","description":"Chatbot module using OpenAI","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","start":"node dist/index.js","test":"jest"},"keywords":["chatbot","openai","ai","npm"],"author":{"name":"Alik"},"license":"MIT","dependencies":{"@alikjs/chatbot":"^1.0.1","axios":"^1.6.3","openai":"^4.24.1"},"devDependencies":{"@types/jest":"^29.5.11","@types/node":"^16.11.16","jest":"^27.5.1","typescript":"^4.5.4"},"gitHead":"94b309f8e93b0a47a748c8a65f9b20e3a682e31a","_id":"@alikjs/chatbot@1.0.1-test","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-uiEa52WEhCJ6fyILZpp4BEO+grNl0T3vEHH//3z3gMKmpBkb55qO4HEpb/YWz1WR9CKdjdb73gzoz7ntRQyLPQ==","shasum":"9c1aa4a5650da038246439731dc5191205dff4a5","tarball":"https://registry.npmjs.org/@alikjs/chatbot/-/chatbot-1.0.1-test.tgz","fileCount":22,"unpackedSize":17413,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPUbGVeVzn2Cr57gvKD7/zvPgvN0eUCkf9F+hu/2vHmwIgXF9+/23fuuK5+ZzJocHmnf7Sdnd0cYhbhTUjRgdpMlc="}]},"_npmUser":{"name":"contributortymara","email":"ujumen1827@gmail.com"},"directories":{},"maintainers":[{"name":"contributortymara","email":"ujumen1827@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chatbot_1.0.1-test_1703748737826_0.46740637552105513"},"_hasShrinkwrap":false}},"maintainers":[{"name":"contributortymara","email":"ujumen1827@gmail.com"}],"description":"Chatbot module using OpenAI","keywords":["chatbot","openai","ai","npm"],"author":{"name":"Alik"},"license":"MIT","readme":"# @alikjs/chatbot\r\n\r\n`@alikjs/chatbot` is a powerful library designed for creating and interacting with chatbots. It offers a straightforward and flexible interface for sending messages to chatbots, managing configurations, and handling responses. The library leverages cutting-edge technologies and ensures seamless interaction across various chatbot platforms.\r\n\r\n## Key Features\r\n\r\n1. Creating and configuring chatbots using an API key.\r\n2. Sending messages and processing responses from the chatbot.\r\n3. A flexible and user-friendly interface.\r\n\r\n## Installation\r\n\r\nInstall the library via npm:\r\n\r\n```bash\r\nnpm install @alikjs/chatbot\r\n```\r\n\r\n## Usage Example\r\nJavascript:\r\n```js\r\nconst ChatBot = require('@alikjs/chatbot');\r\nconst { changeBotLanguage } = require('@alikjs/chatbot/dist/index');\r\nconst { getLanguage } = require('@alikjs/chatbot/src/languageHandler');\r\n\r\nconst bot = ChatBot.createChatBot({ apiKey: 'YOUR_API_KEY' });\r\n\r\nlet lang = 'en'; // По умолчанию устанавливаем английский язык\r\n\r\n// Функция для смены языка\r\nfunction changeLanguage(language) {\r\n  changeBotLanguage(language);\r\n  lang = language;\r\n}\r\n\r\nconst message = {\r\n  text: 'Hello, chatbot!',\r\n  timestamp: Date.now(),\r\n};\r\n\r\nbot.sendMessage(message)\r\n  .then(response => {\r\n    console.log('Response from chatbot:', response);\r\n  })\r\n  .catch(error => {\r\n    console.error('Error sending message:', error);\r\n  });\r\n\r\n// Пример использования смены языка\r\nchangeLanguage('ru');\r\nconsole.log('Текущий язык:', getLanguage());\r\n```\r\n\r\n## Changelog\r\n28.12.2023 - package published... [tested]\r\n\r\n## Documentation\r\n\r\nWelcome to the documentation for @alikjs/chatbot! This library provides functionality for interacting with chatbots using a simple and powerful API.\r\n\r\n# Methods\r\n\r\n`createChatBot(config: ChatBotConfig): ChatBotInstance`\r\nCreates a new instance of the chatbot with the provided configuration.\r\n\r\n`sendMessage(message: ChatBotMessage): Promise<ChatBotResponse>`\r\nSends a message to the chatbot and returns a Promise that resolves to the response.\r\n\r\n# Configuration Options\r\n1. `apiKey`: The API key required for authentication with the chatbot platform.\r\n\r\n# License\r\n\r\nMIT License\r\n\r\nCopyright (c) 2023 Alik\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n","readmeFilename":"README.md"}