botfront / rasa-webchat Goto Github PK
View Code? Open in Web Editor NEWA feature-rich chat widget for Rasa and Botfront
Home Page: https://botfront.io/rasa
License: Apache License 2.0
A feature-rich chat widget for Rasa and Botfront
Home Page: https://botfront.io/rasa
License: Apache License 2.0
Is there any way to increase the size of the chat window. I wanted to increase its width in a website.
How to increase it?
Hello!
Is there a way to send a Message as raw HTML?
I've got a custom action that's getting called, generating a Message containing some links retrieved from a database, which then are saved into a slot, which content is than echoed in the the Bots response.
At the Moment, the HTML seems to get escaped, so I'm getting
<a href="http://127.0.0.1/test/****>****Title, where the URL is a clickable Link instead of
just showing ****Title as a clickable Link.
Is there a way of changing this behavior? Is this even a problem with the chat script or is this an issue with Rasa?
Hi
I'm not a web developer but I wonder if it is possible to integrate speech recognition so that user can choose to chat or speak with the chatbot.
if so how difficult it is to get it up and ready ?
Thanks for your feedback
Hi, i need some help please
Im trying to use the plugin with socket.io in localhost but the chat plugin gets stuck at "Waiting for server..." phase.
This is the code fragment i'm using for the web server:
const server = require('http').createServer();
const io = require('socket.io')(server);
io.on('connection', function(socket){
console.log('a user connected');
//console.log(socket)
io.emit('bot_uttered', {"text": "hola, soy jean pierre el servidor"})
socket.on('user_uttered',function(message){
console.log(message);
return true;
});
return true;
});
server.listen(3000);
When the client connects the message from the server is sent but im unable to write from the client side.
im suspecting that it has something to do with
initPayload: "/get_started"
but i havent found anywhere what that options is suposed to do.
Thaks!
If you click on a button to open the chat window, it opens the chat (but doesn't send the initial payload). You then chat to it for a bit, then close the window and open it again and then the initial payload gets sent in the middle of the conversation.
This is using version 0.4.2 in the webchat widget, basically it shouldn't send the initial payload if the conversation is already happening
Guilty seems to be the Roboto font. When commenting the font the text gets bigger
.message {
margin: 10px;
display: flex;
/* font-size: 14px; /
/ font-family: "Roboto", serif; */
}
My bot should utter a message with two buttons and right away another, additional message. Unfortunately the buttons only show up for a fraction of a second and disappear, when the other message from the bot is uttered.
In my point of view the buttons should stay in the chat protocol as long as the user has not answered.
Here how my rasa template lookes like:
utter_intro1:
- text: "Hi I am ... These are my use cases... "
buttons:
- title: "Use Case 1"
payload: "/a"
- title: "Use Case 2"
payload: "/b"
- title: "Use Case 3"
payload: "/c"
utter_intro2:
- text: "...but I am also happy to answer other questions from you..."
Hello,
I'm including the webchat widget into my website via a script tag. Now I have to implement some changes and started by downloading the webchat-latest.js which is hard to read because of the optimization. Is there a more readable version somewhere?
Hi
It is a common requirement to escalate a chat from a chatbot to a human. It would be great if you can integrate a functionality, so that the user manually initiates an escalation or automatically by a special message form the socket.io server.
This could be easily implemented by switching to another, alternative socket.io server if requested by the user or by the special message/event from the socket.io server.
Greets
I'm new to this platform and i developed rasa chatbot now i want to connect this widget to my rasa chatbot how to do that, can anyone please explain in detail.
thanks in advance
I’m running the Rasa stack starter pack example with the Rasa webchat widget, embedded as JS script, using the Rasa server socketio setup.
It appears to connect successfully (i.e. when running the rasa stack server, I see the log messages that suggest POST and GET request to e.g. /socket.io/?EIO=3&transport=polling&t=MThFYM_&sid=cfc8653cd08d4ba98127487495d5ad6a are successful and return a 200 code, but the web widget on the page continues to say “Waiting for server…” and the user input field stays disabled. There are also no XHR error messages from the web inspector, suggesting the connection to the Rasa stack server works (I can see these errors as soon as I stop the rasa server).
I feel I'm missing something obvious here, but I’m kind of lost trying to figure out what makes the webchat widget think it is not connected to the server - any pointers or suggestions would be very welcome, thanks!
Hi there! I'm trying to send a video/image to the chat UI from Rasa but this is what i'm getting:
This is a snippet of my actions.py code:
I have an actions server and my socket server code is on another Python file. If I use the SocketIOOUtput Class, it will ask me for a recipient ID which I'm not sure where to get. I'm pretty new to Python and Rasa. Any help would be much appreciated!
Is there a way to get notified when webchat receives any message or is there a way to get the size of messages?
related to #16
In order to achieve the same behaviour as when a user clicks on the Launcher, it would be awesome to have access to the toggleConversation
function as well. Would you be open to that?
I have set a react prop customData={{"userId": "123"}}
according to the README page. I have successfully connected rasa-webchat to rasa_core via socketio. I cannot get that customData
in my custom rasa_core actions.
Issue: Missing a hint in README on how to retrieve this customData
in rasa_core. This may be very useful for many novices like me.
The general problem: Identification of the user in the rasa core actions. To achieve this I need either:
senderId
from rasa-webchat component in react frontend and attach this id to the user in the database.senderId
or customData
to rasa-webchat.However, I cannot do any of these. I cannot access senderId
in the react component. And I cannot set my custom senderId
. The rasa-webchat react component is closed.
Hi,
I'm new to rasa-webchat, and trying to get it working with an Angular project. SocketIO is running on port 5002, and I can see following GET/POST from the front-end. But no data being exchanged, and UI says "Waiting for server...".
Can anyone please help/advise?
"GET /socket.io/?EIO=3&transport=polling&t=MVz-uNz&sid=a02f3e5509144af494d9e02866296be7 HTTP/1.1" 200 211 25.986784
engineio.server - a02f3e5509144af494d9e02866296be7: Received packet PING data None
engineio.server - a02f3e5509144af494d9e02866296be7: Sending packet PONG data None
"POST /socket.io/?EIO=3&transport=polling&t=MVz_53_&sid=a02f3e5509144af494d9e02866296be7 HTTP/1.1" 200 195 0.015423
I am running RASA on Docker but trying to connect from the webchat I am getting the following error:
Access to XMLHttpRequest at 'http://localhost:5005/socket.io/?EIO=3&transport=polling&t=McN1g06' from origin 'http://localhost:808' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Here my nlu_config.yml
`language: "en"
cors_origins:
Also I created a credentials.yml file
socketio: user_message_evt: user_uttered bot_message_evt: bot_uttered
and added it to the docker-compose command for rasa_core
command: start --core models -c rest --endpoints config/endpoints.yml -u current/ --credentials config/credentials.yml
I am missing something?
PD: Rasa version 0.14
How can I send video through rasa core to the webchat? For images, it is straightforward: just setting a "- image: url" in the bot domain file will do the trick. However, there is no '- video' option, only a custom message that could (or could not) be used to send a video instead. Do you think it is an option? Or maybe the only way is adding a 'send_video_url' method in the rasa core socketio class, similar to the send_image_url (https://github.com/RasaHQ/rasa_core/blob/d3a435b6b1b68db90d309d4da38f9247416a825d/rasa_core/channels/socketio.py#L56) method?
Hello Everyone,
Thanks for this Chat Widget first of all, I have tried implementing this chat widget, everything works fine except on opening html page chat windows runs a custom action by default which is not supposed to happen.
How to make default utter greet message on first load ?
Please help.
Thanks,
Hari
Node version : v6.11.5
React version : 16.5.2
npm version : 3.5.2
yarn version : 1.10.1
npm:
sudo npm install --save react-chat-widget
yarn
sudo yarn add react-chat-widget
can anyone tell. what is the dependencies ?
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 silly lifecycle [email protected]~prebuild: no script for prebuild, continuing
7 info lifecycle [email protected]~build: [email protected]
8 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~build: PATH: /usr/share/npm/bin/node-gyp-bin:/home/user/Videos/rasa-webchat-master/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/usr/local/java/jdk-10/bin:/usr/local/java/jdk-10/jre/bin
10 verbose lifecycle [email protected]~build: CWD: /home/user/Videos/rasa-webchat-master
11 silly lifecycle [email protected]~build: Args: [ '-c', 'webpack-cli --config webpack.prod.js' ]
12 silly lifecycle [email protected]~build: Returned: code: 2 signal: null
13 info lifecycle [email protected]~build: Failed to exec build script
14 verbose stack Error: [email protected] build: `webpack-cli --config webpack.prod.js`
14 verbose stack Exit status 2
14 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:920:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/user/Videos/rasa-webchat-master
17 error Linux 4.13.0-46-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
19 error node v6.11.4
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error [email protected] build: `webpack-cli --config webpack.prod.js`
22 error Exit status 2
23 error Failed at the [email protected] build script 'webpack-cli --config webpack.prod.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the rasa-webchat package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error webpack-cli --config webpack.prod.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs rasa-webchat
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls rasa-webchat
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Hello. Thanks for this widget, it has a lot of potential.
For two months I use rasa-webchat without using React (only using html and script).
Now using React I'm trying to import the Component to my project using the steps in README, but it appears this error when I try to use the Component:
`
ERROR in ./node_modules/rasa-webchat/index.js 9:6
Module parse failed: Unexpected token (9:6)
You may need an appropriate loader to handle this file type.
|
| ReactDOM.render(
<Widget
| socketUrl={args.socketUrl}
| socketPath={args.socketPath}
@ ./src/components/WebChat/WebChat.js 19:0-38 38:29-35
@ ./src/routes.js
@ ./src/index.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:3000 ./src/index.js`
I'm using React 16.6.3 with Webpack 4.26 and node 10.14.1.
Someone could help me? :(
Thanks
As a bot creator, I would like to persist the state of the conversation in the browser to be able to continue it when the user comes back to the hosting web page, or even across web pages on the same host.
This has 2 impacts:
The socket session id cannot be safely customized, which means that it cannot be used as a user id (or sender_id in Rasa Core terms). The socket server must implement a store mapping socket ids and the bot session or user id.
On connect
:
socket.userId = localStorage.get(...)
) so when a message is emitted the server can map it to the correct stored conversation.socket.userId
when it receives a message. That is the signal of a new user or conversation. Then the server will create a user id and attach it to the socket so future messages can be attached to that session.SocketIOInput
changesA SessionStore
mapping socket.io id
's and core sender_id
's must be added. A simple interface that can support several implementations, similarly to the TrackerStore
When a new message comes here (https://github.com/RasaHQ/rasa_core/blob/master/rasa_core/channels/socketio.py#L141) the mapping happens.
The conversation can be stored locally under the userId
key in the localStorage
or sessionStorage
. Probably an array of messages in the native format that can be fed to the widget at initialization time.
A new prop storage
accepting values local
and session
could be added depending on the persistence required
If not set the conversation vanishes (current behaviour)
https://www.robinwieruch.de/local-storage-react/
See discussion here: botfront/rasa-addons#15
I was thinking in the case of a chatbot that can interpret text AND images sent by the user. It is doable? Adding this feature to the chatbot interface?
there is no error reported , just not showing
any one met this issue?
I also tried react-chat-widget , it can show up
A similar issue was reported on the original repository, see: Wolox/react-chat-widget/issues/76
Any chance of a fix?
Thanks in advance,
how to make the bot to say hello when it's started?
Hi,
each new bot message like buttons dissappear after user clicks or bot outputs a new button? That is bad to follow dialogue or when bot utter two buttons like for contact or feedback...
How can I prevent this?
I use it as the script version just shown here:
https://github.com/mrbot-ai/rasa-webchat#as-a-script
var widget = WebChat.default.init(...)
widget.open()
widget.close()
widget.hide()
widget.show()
@TheoTomalty @dliuproduction thoughts?
there is a function or an exposed prop that displays 'typing dots' while user waiting for an answer? I can not find it. How have you solved this problem? there is same fork of this project that improve this gui component?
thanks...
hide logs by default
I am trying to use rasa-webchat Widget in an new ReactJs project but
when I do npm test in bitbucket pipeline I get the following error
/opt/atlassian/pipelines/agent/build/node_modules/rasa-webchat/index.js:1
({"Object.":function(module,exports,require,__dirname,__filename,global,jest){import React from 'react';
SyntaxError: Unexpected identifier
1 | import React, { Component } from 'react';
> 2 | import { Widget } from 'rasa-webchat';
I tried the same code changing the import from rasa-webchat to react-chat-widget and it works fine. So I think there is something wrong happening due to this plugin
I'm using this Docker image on my pipeline: node:11.6.0
Here are my dependencies :
"dependencies": {
"rasa-webchat": "github:mrbot-ai/rasa-webchat",
"react": "^15.6.2",
"react-chat-widget": "^2.1.4-1",
"react-dom": "^15.6.2",
"react-scripts": "2.1.3"
}
Any help would be appreciated
Hi all - this is a question rather than an issue/problem as such, hope it's ok to bring it up here.
I have a client requirement where I need to trigger an action/message from the webpage that the Rasa webchat widget is embedded on. E.g. someone clicks on a link on the web page, and a custom action or message appears in the webchat widget that's embedded on that page.
I was vaguely thinking maybe making a POST request to the Rasa action server, duplicating what Rasa Core sends to it, but I'm not sure how to match things like sender ids etc to make that work (if it's even possible).
I realise this may be outside the scope of this, so feel free to close it so, I was just wondering in case anyone here had done something similar before.
If I run the core as a socket.io server directly as is described in the rasa docs:
https://rasa.com/docs/core/connectors/#socketio-connector
I get polling requests to the Rasa server which return 404s. And the web page is blank.
If I run the core as a socket.io server using python as is described in the rasa docs:
https://rasa.com/docs/core/connectors/#id21
I get polling requests to the Rasa server which return 200s. And the web page is blank.
Is there a a UI served from index.html?
Thanks!
Hi I tried to install rasa-webachat , please find the below error details
npm ERR! prepareGitDep 1>
npm ERR! prepareGitDep > [email protected] install /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/node-sass
npm ERR! prepareGitDep > node scripts/install.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep Cached binary found at /home/ec2-user/.npm/node-sass/4.10.0/linux-x64-57_binding.node
npm ERR! prepareGitDep
npm ERR! prepareGitDep > [email protected] postinstall /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/node-sass
npm ERR! prepareGitDep > node scripts/build.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep Binary found at /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/node-sass/vendor/linux-x64-57/binding.node
npm ERR! prepareGitDep Testing binary
npm ERR! prepareGitDep Binary is fine
npm ERR! prepareGitDep
npm ERR! prepareGitDep > [email protected] prepare /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f
npm ERR! prepareGitDep > npm run build
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep > [email protected] build /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f
npm ERR! prepareGitDep > webpack-cli --config webpack.prod.js
npm ERR! prepareGitDep
npm ERR! prepareGitDep
npm ERR! prepareGitDep 2> npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
npm ERR! prepareGitDep npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
npm ERR! prepareGitDep npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm ERR! prepareGitDep npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm ERR! prepareGitDep npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! prepareGitDep /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/config-yargs.js:89
npm ERR! prepareGitDep describe: optionsSchema.definitions.output.properties.path.description,
npm ERR! prepareGitDep ^
npm ERR! prepareGitDep
npm ERR! prepareGitDep TypeError: Cannot read property 'properties' of undefined
npm ERR! prepareGitDep at module.exports (/home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/config-yargs.js:89:48)
npm ERR! prepareGitDep at /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/webpack.js:60:27
npm ERR! prepareGitDep at Object.<anonymous> (/home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/webpack.js:515:3)
npm ERR! prepareGitDep at Module._compile (module.js:653:30)
npm ERR! prepareGitDep at Object.Module._extensions..js (module.js:664:10)
npm ERR! prepareGitDep at Module.load (module.js:566:32)
npm ERR! prepareGitDep at tryModuleLoad (module.js:506:12)
npm ERR! prepareGitDep at Function.Module._load (module.js:498:3)
npm ERR! prepareGitDep at Function.Module.runMain (module.js:694:10)
npm ERR! prepareGitDep at startup (bootstrap_node.js:204:16)
npm ERR! prepareGitDep npm ERR! code ELIFECYCLE
npm ERR! prepareGitDep npm ERR! errno 1
npm ERR! prepareGitDep npm ERR! [email protected] build: `webpack-cli --config webpack.prod.js`
npm ERR! prepareGitDep npm ERR! Exit status 1
npm ERR! prepareGitDep npm ERR!
npm ERR! prepareGitDep npm ERR! Failed at the [email protected] build script.
npm ERR! prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! prepareGitDep
npm ERR! prepareGitDep npm ERR! A complete log of this run can be found in:
npm ERR! prepareGitDep npm ERR! /home/ec2-user/.npm/_logs/2018-12-03T06_31_26_817Z-debug.log
npm ERR! prepareGitDep npm ERR! code ELIFECYCLE
npm ERR! prepareGitDep npm ERR! errno 1
npm ERR! prepareGitDep npm ERR! [email protected] prepare: `npm run build`
npm ERR! prepareGitDep npm ERR! Exit status 1
npm ERR! prepareGitDep npm ERR!
npm ERR! prepareGitDep npm ERR! Failed at the [email protected] prepare script.
npm ERR! prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! prepareGitDep
npm ERR! prepareGitDep npm ERR! A complete log of this run can be found in:
npm ERR! prepareGitDep npm ERR! /home/ec2-user/.npm/_logs/2018-12-03T06_31_27_051Z-debug.log
npm ERR! prepareGitDep
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: github:mrbot-ai/rasa-webchat.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ec2-user/.npm/_logs/2018-12-03T06_31_27_196Z-debug.log
[ec2-user@ip-10-0-0-4 node_modules]$ cat /home/ec2-user/.npm/_logs/2018-12-03T06_31_27_196Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli 'mrbot-ai/rasa-webchat' ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /home/ec2-user/.npmrc. (matches userconfig)
5 verbose npm-session 6f4e287f482cd2f8
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 verbose prepareGitDep undefined: installing devDeps and running prepare script.
9 error prepareGitDep 1>
9 error prepareGitDep > [email protected] install /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/node-sass
9 error prepareGitDep > node scripts/install.js
9 error prepareGitDep
9 error prepareGitDep Cached binary found at /home/ec2-user/.npm/node-sass/4.10.0/linux-x64-57_binding.node
9 error prepareGitDep
9 error prepareGitDep > [email protected] postinstall /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/node-sass
9 error prepareGitDep > node scripts/build.js
9 error prepareGitDep
9 error prepareGitDep Binary found at /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/node-sass/vendor/linux-x64-57/binding.node
9 error prepareGitDep Testing binary
9 error prepareGitDep Binary is fine
9 error prepareGitDep
9 error prepareGitDep > [email protected] prepare /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f
9 error prepareGitDep > npm run build
9 error prepareGitDep
9 error prepareGitDep
9 error prepareGitDep > [email protected] build /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f
9 error prepareGitDep > webpack-cli --config webpack.prod.js
10 error prepareGitDep 2> npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.
10 error prepareGitDep npm WARN deprecated [email protected]: 🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
10 error prepareGitDep npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
10 error prepareGitDep npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
10 error prepareGitDep npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
10 error prepareGitDep /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/config-yargs.js:89
10 error prepareGitDep describe: optionsSchema.definitions.output.properties.path.description,
10 error prepareGitDep ^
10 error prepareGitDep
10 error prepareGitDep TypeError: Cannot read property 'properties' of undefined
10 error prepareGitDep at module.exports (/home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/config-yargs.js:89:48)
10 error prepareGitDep at /home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/webpack.js:60:27
10 error prepareGitDep at Object.<anonymous> (/home/ec2-user/.npm/_cacache/tmp/git-clone-b486576f/node_modules/webpack-cli/bin/webpack.js:515:3)
10 error prepareGitDep at Module._compile (module.js:653:30)
10 error prepareGitDep at Object.Module._extensions..js (module.js:664:10)
10 error prepareGitDep at Module.load (module.js:566:32)
10 error prepareGitDep at tryModuleLoad (module.js:506:12)
10 error prepareGitDep at Function.Module._load (module.js:498:3)
10 error prepareGitDep at Function.Module.runMain (module.js:694:10)
10 error prepareGitDep at startup (bootstrap_node.js:204:16)
10 error prepareGitDep npm ERR! code ELIFECYCLE
10 error prepareGitDep npm ERR! errno 1
10 error prepareGitDep npm ERR! [email protected] build: `webpack-cli --config webpack.prod.js`
10 error prepareGitDep npm ERR! Exit status 1
10 error prepareGitDep npm ERR!
10 error prepareGitDep npm ERR! Failed at the [email protected] build script.
10 error prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10 error prepareGitDep
10 error prepareGitDep npm ERR! A complete log of this run can be found in:
10 error prepareGitDep npm ERR! /home/ec2-user/.npm/_logs/2018-12-03T06_31_26_817Z-debug.log
10 error prepareGitDep npm ERR! code ELIFECYCLE
10 error prepareGitDep npm ERR! errno 1
10 error prepareGitDep npm ERR! [email protected] prepare: `npm run build`
10 error prepareGitDep npm ERR! Exit status 1
10 error prepareGitDep npm ERR!
10 error prepareGitDep npm ERR! Failed at the [email protected] prepare script.
10 error prepareGitDep npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
10 error prepareGitDep
10 error prepareGitDep npm ERR! A complete log of this run can be found in:
10 error prepareGitDep npm ERR! /home/ec2-user/.npm/_logs/2018-12-03T06_31_27_051Z-debug.log
11 silly fetchPackageMetaData error for github:mrbot-ai/rasa-webchat Non-registry package missing package.json: github:mrbot-ai/rasa-webchat.
12 timing stage:rollbackFailedOptional Completed in 1ms
13 timing stage:runTopLevelLifecycles Completed in 43704ms
14 verbose stack Error: Non-registry package missing package.json: github:mrbot-ai/rasa-webchat.
14 verbose stack at BB.join (/usr/lib/node_modules/npm/node_modules/pacote/lib/finalize-manifest.js:162:23)
14 verbose stack at tryCatcher (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
14 verbose stack at Holder$5._callFunction (eval at generateHolderClass (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:14:44)
14 verbose stack at Holder$5.checkFulfillment (eval at generateHolderClass (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:29:30)
14 verbose stack at Promise.eval (eval at thenCallback (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:14:16), <anonymous>:6:20)
14 verbose stack at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
14 verbose stack at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
14 verbose stack at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
14 verbose stack at Promise._fulfill (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
14 verbose stack at Object.<anonymous> (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21)
14 verbose stack at emitNone (events.js:111:20)
14 verbose stack at Object.emit (events.js:208:7)
14 verbose stack at Object.Parser.on._ (/usr/lib/node_modules/npm/node_modules/tar/lib/parse.js:75:14)
14 verbose stack at emitTwo (events.js:126:13)
14 verbose stack at Object.emit (events.js:214:7)
14 verbose stack at Object.[emit] (/usr/lib/node_modules/npm/node_modules/tar/lib/parse.js:229:12)
15 verbose cwd /home/ec2-user/node_modules
16 verbose Linux 3.10.0-862.14.4.el7.x86_64
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "mrbot-ai/rasa-webchat"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ENOPACKAGEJSON
21 error package.json Non-registry package missing package.json: github:mrbot-ai/rasa-webchat.
22 error package.json npm can't find a package.json file in your current directory.
23 verbose exit [ 1, true ]
please let me know how to resolve this.
Regards
Swagat
As a bot developer, I would like to build conversational flows spreading on several web pages.
Example 1: A customer asks for a shipping update on an e-commerce site. The bot answers with an order shipment link. The user clicks the link and the widget continues the conversation on the new page (e.g.: waits 30 seconds, opens, and pushed a message. But I don't want the widget to pop up any time a user hits or refreshes the page
Example 2: Customer walkthrough. The bot is guiding a user through a web app, page by page. Once the user gets to the next page, (s)he gets the next instruction.
##Implementation idea
An array of widget_event
s is stored in the local storage:
{
url: '' // url regex
actions: ["show","open","full_screen"], // sequence of widget events
delay: 10, // delay in second
expires: UTC timestamp,
payload: "/intent{'entity':'value'}"
}
When the widget in instantiated on a page, it looks for a match (current url agains the urls in the widget events) in the events stored in local storage. If it finds a match, the event is removed and executed (i.e after the delay
, and unless the event has expireed, the sequence in action
is executed and the payload
sent.
widget_event
s to the widget.The easiest way would be to keep using the bot_uttered
socket event (instead of using another one)
Then a different type of message could be sent by the server (e.g. Rasa Core), that instead of displaying a message would just create a widget event as described above.
A Core story example:
## story
* whatever_intent
- utter_follow_that_link // "Please follow the following link"
- action_set_widget_event // Send the widget event
To send the widget event the send_custom_message
could be overriden in the SocketIOOutput
The payload would just be the widget event
Possible limitation: the dispatcher send_custom_message
only supports the elements
object, see if that can be easily overriden
Often chatbots cannot handle or they become confused because of multiple inputs in a row from the user.
Because of this a common approach is to block the user from writing/input until a response form the chatbot is delivered.
Could you please develop this as a feature that can be enabled in the configuration?
Hi everyone,
I just tried to use the webchat just as it is described here by Juste.
I can see a 500 code in Chrome's console saying Access to XMLHttpRequest at 'http://localhost:5005/socket.io/?EIO=3&transport=polling&t=MYei2_H' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Also python is facing me with an AttributeError:
127.0.0.1 - - [2019-02-01 11:55:46] "GET /socket.io/?EIO=3&transport=polling&t=MYeiq3t HTTP/1.1" 500 161 0.003995
Traceback (most recent call last):
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\gevent\pywsgi.py", line 976, in handle_one_response
self.run_application()
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\gevent\pywsgi.py", line 923, in run_application
self.result = self.application(self.environ, self.start_response)
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\flask\app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\engineio\middleware.py", line 59, in __call__
return self.engineio_app.handle_request(environ, start_response)
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\socketio\server.py", line 360, in handle_request
return self.eio.handle_request(environ, start_response)
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\engineio\server.py", line 333, in handle_request
transport, b64)
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\engineio\server.py", line 454, in _handle_connect
s = socket.Socket(self, sid)
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\engineio\socket.py", line 17, in __init__
self.queue = self.server.create_queue()
File "C:\Users\niklas.fallik\AppData\Local\Continuum\anaconda3\envs\py36\lib\site-packages\engineio\server.py", line 430, in create_queue
sys.modules[queue.__class__.__module__], 'Empty')
AttributeError: 'gevent._queue.JoinableQueue' object has no attribute 'Empty'
2019-02-01T10:55:53Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '57190', 'HTTP_HOST': 'localhost:5005', (hidden keys: 23)} failed with AttributeError
The "REMOTE_PORT" is changing once a while.
I used the html-code provided in dev/src/index.html. Chrome shows an empty page.
What am I missing?
Regards,
Nick
Hello,
When running my bot, I'm getting this error message :
(base) C:\Users\Albel\Documents\demobotdc>python bot.py
2018-10-02 18:31:29.374440: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
127.0.0.1 - - [2018-10-02 18:31:50] "GET /socket.io/?EIO=3&transport=polling&t=MOrdnFm HTTP/1.1" 200 365 0.001001
127.0.0.1 - - [2018-10-02 18:32:15] "POST /socket.io/?EIO=3&transport=polling&t=MOrdtRR&sid=b654279ca4a449f4a610ffb10ebd45bd HTTP/1.1" 200 195 0.000998
127.0.0.1 - - [2018-10-02 18:32:15] "GET /socket.io/?EIO=3&transport=polling&t=MOrdnKo&sid=b654279ca4a449f4a610ffb10ebd45bd HTTP/1.1" 200 211 25.311718
message handler error
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\engineio\server.py", line 411, in _trigger_event
return self.handlers[event](*args)
File "C:\Anaconda3\lib\site-packages\socketio\server.py", line 522, in _handle_eio_message
self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
File "C:\Anaconda3\lib\site-packages\socketio\server.py", line 458, in _handle_event
self._handle_event_internal(self, sid, data, namespace, id)
File "C:\Anaconda3\lib\site-packages\socketio\server.py", line 461, in _handle_event_internal
r = server._trigger_event(data[0], namespace, sid, *data[1:])
File "C:\Anaconda3\lib\site-packages\socketio\server.py", line 490, in _trigger_event
return self.handlers[namespace][event](*args)
File "c:\users\albel\documents\rasanlutrainer\rasa install\core\rasa_core\channels\socketio.py", line 142, in handle_message
message = UserMessage(data['message'], output_channel, sid,
KeyError: 'message'
my python code is :
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
import warnings
import ruamel
from rasa_core.channels.socketio import SocketIOInput
from rasa_core.agent import Agent
from rasa_core.interpreter import RegexInterpreter
from rasa_core.interpreter import RasaNLUInterpreter
logger = logging.getLogger(__name__)
def run_bot():
interpreter = RasaNLUInterpreter('./models/nlu/default/demobotnlu')
#agent = Agent.load('./models/dialogue/', interpreter=RegexInterpreter())
agent = Agent.load('./models/dialogue/', interpreter=interpreter)
input_channel = SocketIOInput(
# event name for messages sent from the user
user_message_evt="user_uttered",
# event name for messages sent from the bot
bot_message_evt="bot_uttered",
# socket.io namespace to use for the messages
namespace=None)
# set serve_forever=False if you want to keep the server running
s = agent.handle_channels([input_channel], 5600, serve_forever=True)
if __name__ == '__main__':
warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)
run_bot()
What is triggering this message ?
Thanks for your feedbak
It looks like on mobile, the widget-container class overlaps the page content when the widget is minimized/closed, so e.g. links on the page the widget is embedded on are not clickable.
Folks, can I send a html table as message? It is rendering as plain text.
Thanks
Emannuel Roque
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.