howdyai / botkit-cms Goto Github PK
View Code? Open in Web Editor NEWAn open tool for designing, building and managing interactive dialog systems
Home Page: https://botkit.ai
License: MIT License
An open tool for designing, building and managing interactive dialog systems
Home Page: https://botkit.ai
License: MIT License
I did step by step to run it locally as stated in https://github.com/howdyai/botkit-cms
but error show after I exec "NPM Run Build"
I'll be very appreciate it if you can help...
Thanks before
I have two conditions: yes or no. If yes trigger action 2, if no trigger action 6. Only one action works whichever is added as a first condition.
My sample json is:
{
"pattern": "no",
"type": "utterance",
"action": "6"
},
{
"pattern": "yes",
"type": "utterance",
"action": "2"
}
After completing the steps in the README, I ran "npm run build".
This step returned the error below on the new Apple silicon. The expected result was a successful build.
Error: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (88)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.9.4
Model Name: MacBook Pro
Model Identifier: MacBookPro17,1
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB
System Firmware Version: 6723.61.3
Hi
I got this error when I try get the cms up and running;
`root@3b74527adc70:/app# npm start
[email protected] start /app
node index.js
internal/modules/cjs/loader.js:796
throw err;
^
Error: Cannot find module '/app/src/api.js'
Require stack:
node index.js
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-03-02T16_33_07_062Z-debug.log
`
Before that, "npm run build" was successful like this;
`root@3b74527adc70:/app# npm run build
[email protected] build /app
./node_modules/gulp/bin/gulp.js
[16:32:09] Using gulpfile /app/gulpfile.js
[16:32:09] Starting 'default'...
[16:32:09] Starting 'controller-concat'...
[16:32:09] Concatenating and Copying Controllers...
[16:32:10] Finished 'controller-concat' after 26 ms
[16:32:10] Starting 'copy-partials'...
[16:32:10] Copying HTML partials...
[16:32:10] Finished 'copy-partials' after 7.53 ms
[16:32:10] Starting 'copy-more-partials'...
[16:32:10] Copying HTML partials...
[16:32:10] Finished 'copy-more-partials' after 4.99 ms
[16:32:10] Starting 'sass'...
[16:32:10] Compiling Sass...
[16:32:10] Finished 'sass' after 5.73 ms
[16:32:10] Finished 'default' after 47 ms
`
Any idea?
Thank you in advance!
We should add documentation about making calls to controller.studio.runTrigger.
The following code should be added to the bot.js file, in addition to configuring the controller with the studio_command_url
parameter:
// This captures and evaluates any message sent to the bot as a DM
// or sent to the bot in the form "@bot message" and passes it to
// Botkit Studio to evaluate for trigger words and patterns.
// If a trigger is matched, the conversation will automatically fire!
// You can tie into the execution of the script using the functions
// controller.studio.before, controller.studio.after and controller.studio.validate
if (process.env.studio_token) {
controller.on('message_received', function(bot, message) {
controller.studio.runTrigger(bot, message.text, message.user, message.channel, message).then(function(convo) {
if (!convo) {
// web bot requires a response of some kind!
bot.reply(message,'OK');
// no trigger was matched
// If you want your bot to respond to every message,
// define a 'fallback' script in Botkit Studio
// and uncomment the line below.
// controller.studio.run(bot, 'fallback', message.user, message.channel, message);
} else {
// set variables here that are needed for EVERY script
// use controller.studio.before('script') to set variables specific to a script
convo.setVar('current_time', new Date());
convo.setVar('bot', controller.studio_identity);
}
}).catch(function(err) {
bot.reply(message, 'I experienced an error with a request to Botkit Studio: ' + err);
debug('Botkit Studio: ', err);
});
});
} else {
console.log('~~~~~~~~~~');
console.log('NOTE: Botkit Studio functionality has not been enabled');
console.log('To enable, pass in a studio_token parameter with a token from https://studio.botkit.ai/');
}```
Can we as a community fork into a better maintained project? Any ideas? Thank you.
Hey,
I am trying to get botkit-cms working locally within a botkit app. I think this would be ideal for a production deployment, not having to rely on another server to be up.
I am using
"botkit": "^4.0.2",
"botkit-cms": "0.0.4",
"botkit-plugin-cms": "^1.0.1",
When I follow the directions and include:
var cms = require('botkit-cms')();
cms.useLocalStudio(controller);
cms.loadScriptsFromFile(__dirname + '/scripts.json').catch(function(err) {
console.error('Error loading scripts', err);
});
I get the following error: TypeError: Cannot set property 'evaluateTrigger' of undefined
.
I fixed here this by changing the controller.studio
references to be controller.plugins.cms
. This seems to fix the problem and things seem to more or less work. The bot responds to the triggers that are setup.
However, there is an exception when the input is something that doesn't cause any triggers to be returned.
Error in trigger handler undefined
(node:53014) UnhandledPromiseRejectionWarning: Error:
at Botkit.<anonymous> (blah/blah/node_modules/botkit/src/core.ts:1036:27)
Thanks for any help or direction on how to continue looking into this.
Hi,
I tried to follow starting guide - adding botkit-cms as component in Botkit App. Unfortunately I can not make it works. Here are my steps:
npm install -g botkit
botkit new --platform web
npm install --save botkit-cms
var controller = Botkit.socketbot(bot_options);
var cms = require('botkit-cms')();
cms.useLocalStudio(controller);
cms.loadScriptsFromFile(__dirname + '/scripts.json'); // How I can get scripts.json ??
I believe I don't see any scripts.json , and I am not sure if my understanding to register new component is correct.
Would anyone help me and guide me what should I do to configure botkit-cms web?
Thanks.
Riwut
Hey there!
I'd like to report a security issue but cannot find contact instructions on your repository.
If not a hassle, might you kindly add a SECURITY.md
file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.
Thank you for your consideration, and I look forward to hearing from you!
(cc @huntr-helper)
Hello!
I've created a model with a few intents and have it connected to botkit-cms, and then my bot connected to that. So far everything seems to function as expected. When configuring scripts and their associated triggers, I can select the intents from my model and things work great.
Once inside a script, is there also a way to have the conditional actions use my model's intents to choose what to do? So instead of exact/regex matching, use the model intent prediction like the trigger mechanism?
Thanks!
Something happens that removes all files
Hello,
Thanks immensely to this wonderful piece of software. It rocks!
It appears the npm version of botkit-cms (0.0.4, at this time) is ahead of the version specified in the package.json file (0.0.3, at this time).
Some suggestions:
This will make it easier to update live botkit-cms servers to specific versions, as the case may be.
Thanks, once again.
Warm regards, please.
Adebisi, FA.
Hi,
I have a use case to write multiple instances of botkit-cms and can't see a way to do it because the storage is on the file system(?) or in-memory?
Is there any way to have botkit-cms store the scripts in a database?
I have install botkit app and botkit-cms, but how to connect and sync them?
already config the .env and create scripts.json, but still no luck.
While working with the cms locally, using useLocalStudio = true
, evaluateTrigger
doesn't exactly behave the way it should. In the case where no trigger was matched, the promise is rejected (which it should resolve to mimic the functionality of CMS run as remote API service)
Line 252 in a98c9b8
When run as an API service, evaluateTrigger
always resolves, even when there was no match. This in turn affects the Promise object returned by runTrigger
Also have a look at howdyai/botkit@ef69730
I have a use case to share persistent storage across multiple instances of botkit-cms which excludes file system.
What would be the best approach to have persistent storage shared across multiple instances of botkit-cms?
Hello,
having issues with building ui components .. i can not build quick replies using the interface
Hi,
I have botkit and botkit-cms on the same server, both of them are running and everything fine.
I added the following to .env file (on botkit) and configured the .env on botkit-cms.
var controller = Botkit.web({
studio_command_uri: 'http://MyIP:3000',
studio_token: 'blablablabla',
});
##Chat platform
PLATFORM=web
##authentication tokens for Bot users
TOKENS=blablablabla
##Admin users for UI
USERS=admin:mypass
I added some text into the CMS framework and when I am checking the bot after the amendments in the CMS, nothing happens.
It looks like that something is not connected well, how to connect them? how to check that they are talking to each other?
Thanks a lot
It would be great if the CMS supported Adaptive cards (at least when authoring the web client).
https://docs.microsoft.com/en-us/adaptive-cards/resources/future
Hi,
I am using botkit and have setup botkit-cms version 0.0.3 running locally. I added a new dialog named hello and saved it with the defaults. When I type hello into slack there is an error:
A dialog with an id of 'hello:botkit-wrapper' wasn't found.
I am using:
"botbuilder-adapter-slack": "^1.0.2",
"botkit": "^4.0.1",
"botkit-plugin-cms": "^1.0.0"
I am not sure if its caused by the way botkit-cms writes the script file or if its the way the botkit/botworker reads the file. If I remove id + ':botkit-wrapper'
from the botkit/botworker beginDialog
code the hello dialog executes fine.
Am I missing something simple?
Thanks!
I have created a chatbot with following steps, which is working fine.
npm install -g botkit
botkit new --platform web
npm install --save botkit-cms
Then, I removed the scripts in the skills folder (except _connection_events.js) & created a new script with code
module.exports = function(controller) {
controller.on('message_received', function(bot, message) {
controller.studio.runTrigger(bot, message.text, message.user, message.channel).catch(function(err) {
bot.reply(message, {text: 'Sorry, I don\'t understand.'});
});
});
};
also, added following code after controller initiation in bot.js
var cms = require('botkit-cms')();
cms.useLocalStudio(controller);
cms.loadScriptsFromFile(__dirname + '/scripts.json').catch(function(err) {
console.error('Error loading scripts', err);`
});
and in the root, copied scripts.json
from cms with basic reply for 'hello' command (same as in sample_scripts.json
).
There's no error, but I'm not getting any response from the bot when I pass 'hello' to chatbot.
What wrong I'm doing?
When I run npm install after clone the git repository, I get the next error message on the log file that was created:
7839 verbose stack Error: [email protected] postinstall: node scripts/build.js
7839 verbose stack Exit status 1
7839 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
7839 verbose stack at EventEmitter.emit (events.js:311:20)
7839 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
7839 verbose stack at ChildProcess.emit (events.js:311:20)
7839 verbose stack at maybeClose (internal/child_process.js:1021:16)
7839 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
7840 verbose pkgid [email protected]
7841 verbose cwd /home/user/Proyects/botkit-cms
7842 verbose Linux 4.15.0-65-generic
7843 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
7844 verbose node v12.16.1
7845 verbose npm v6.13.4
7846 error code ELIFECYCLE
7847 error errno 1
7848 error [email protected] postinstall: node scripts/build.js
7848 error Exit status 1
7849 error Failed at the [email protected] postinstall script.
7849 error This is probably not a problem with npm. There is likely additional logging output above.
7850 verbose exit [ 1, true ]
My Configuration:
npm -v
6.13.4
node -v
v12.16.1
Ubuntu LTS 18.04
Any one can help me whats going on?
Regards,
Francisco Yu
Hey,
I have a simple script configured to say yes or no based on the condition if is variation of
However, it never seems to branch to the no condition.
I am using the following:
"botbuilder-adapter-slack": "^1.0.2",
"botbuilder-storage-mongodb": "^0.9.5",
"botkit": "^4.0.2",
"botkit-plugin-cms": "^1.0.1"
And botkit-cms version 0.0.3
Is there a config I am missing? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.