Git Product home page Git Product logo

rasa-webchat's Introduction

npm License Github discussions link


This project is not maintained anymore and will not receive further updates.

HighlightsFeaturesQuick startDevelopment

Release Notes


What is it

Botfront is an open-source enterprise-grade conversational platform built with Rasa. It provides super intuitive interfaces and collaborative features to domain experts, conversational designers and engineers.


Highlights

😎

Easy to use

🎓

Powerful

💻️

Developer friendly

Our main goal is to lower the technical barrier to entry in conversational AI. Implementing context-aware conversations should be as easy as chatting. Botfront uses Rasa, a powerful and production ready conversational AI library. Botfront exposes all Rasa functionalities and abstracts its complexity. Botfront's intuitive CLI orchestrates all Botfront's services on your development machine.
Authoring, training, auto reloading actions code, it just works!

Features

An intuitive interface for stories and rules

Botfront provides a unique and natural conversation authoring experience. You can create complex dialog flows in minutes

A flow chart editor for forms

A super intuitive flow chart editor for conversations that do not require machine learning

Automated tests

Create automated tests in one click from conversations, get detailed reports and deploy in confidence.

Git integration

Version your work on a repository with the new Git integration.

Train & evaluate NLU models

Botfront comes with a complete NLU toolbox. You can tag vast amounts of data efficiently, train and evaluate models. Several evaluation methods are available depending on the development stage of your model, and you can annotate incoming NLU data

Rasa integration

Botfront exposes all Rasa features and concepts and and makes them accessible at a higher level for faster development. You can export a Botfront project and use it with Rasa at any time.

Enterprise ready

Scale your conversational AI practice with enterprise grade projects and user management, RBAC and flexible deployment options.

Quick Start

Botfront only requires a recent version of Docker. You can install the CLI with the following:

npm install -g botfront

Then just run botfrontto get started.


Documentation

The official documentation of Botfront is hosted on botfront.io. It is automatically built and updated on every new release. Once you've installed the cli you can also use botfront docs to open it.

We welcome contributions! It can be as easy as clicking on the "Edit page on Github" link at the bottom of every documentation pages.

Development

Installation

  1. Botfront is a Meteor app, so the first step is to install Meteor
  2. Then clone this repo and install the dependencies:
git clone https://github.com/botfront/botfront
cd botfront/botfront
meteor npm install
  1. Install the CLI from the source code:
# if you installed Botfront from npm uninstall it.
npm uninstall -g botfront
# Install the cli from the source code
cd cli && npm link

Botfront needs to be connected to other services, especially Rasa. To do this, you need to create a regular project, and start Botfront with a dedicated configuration:

  1. Create a Botfront project with botfront init (somewhere else, not in the repo)
  2. Start your project with botfront up -e botfront. This will run all services except the Botfront app, since you are going to run it with Meteor locally
  3. Go back to the botfront checkout cd botfront/botfront and run Botfront with meteor npm run start:docker-compose.dev. Botfront will be available at http://localhost:3000 so open your browser and happy editing 😸

TroubleShooting

Some botfront cli commands that may help if you run into problems:

botfront init     # create a new botfront project
botfront logs     # show the logs!
botfront killall  # stop all docker services
botfront down     # stop all botfront services
botfront up       # restart botfront
botfront docs     # open the docs in your browser

Note that these should be run from the same directory as your botfront project

Contribute

We ❤️ contributions of all size and sorts. If you find a typo, if you want to improve a section of the documentation or if you want to help with a bug or a feature, here are the steps:

  1. Fork the repo and create a new branch, say fix-botfront-typo-1
  2. Fix/improve the codebase
  3. Commit the changes. Commit message must follow the naming convention, say fix(conversation builder): display story groups in alphabetical order
  4. Make a pull request. Pull request name must follow the naming convention. It can simply be one of your commit messages, just copy paste it, e.g. fix(readme): improve the readability and move sections
  5. Submit your pull request and wait for all checks passed (up to an hour)
  6. Request reviews from one of the developers from our core team.
  7. Get a 👍 and PR gets merged.

Well done! Once a PR gets merged, here are the things happened next:

  • all Docker images tagged with branch-master will be automatically updated in an hour. You may check the status on the Actions tab.
  • your contribution and commits will be included in our release note.

Testing

End to end tests are using the Cypress testing framework.

To manually run the Cypress tests, you need to have Botfront running in development mode. Some tests also require Rasa to be available.

Once you are at the root of the repo, you can enter the following.

cd botfront
# if you want to open Cypress' graphical interface
npx cypress open
# If you want to run the whole suite in headless mode
# This could take up to an hour depending on your computer
npx cypress run
# If you want to run a specific test
npx cypress run --spec "cypress/integration/02_training/training.spec.js"

Commit messages naming convention

To help everyone with understanding the commit history of Botfront, we employ commitlint to enforce the commit styles:

type(scope?): subject

where type is one of the following:

  • build
  • ci
  • chore
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

scope is optional, represents the module your commit working on.

subject explains the commit.

As an example, a commit that improved the documentation:

docs(conversation builder): update slots manager screenshot.

License

Copyright (C) 2021 Dialogue Technologies Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.(C) 2021 Dialogue Technologies Inc. All rights reserved.

rasa-webchat's People

Contributors

antistic avatar arththebird avatar charlesj avatar dependabot[bot] avatar dliuproduction avatar epintos avatar facundobringas avatar fortin-mo avatar fparga avatar gausie avatar guillaumetech avatar hub4it avatar ivopisarovic avatar matthieujnon avatar pheel avatar phlf avatar quixote15 avatar rabinpoudyal avatar satyambansal avatar schemeway avatar theotomalty avatar znat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rasa-webchat's Issues

Escalation to human

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

interacting with webchat from within webpage

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.

How to send video from rasa core?

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?

Bug with starting a conversation via button click

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

Unable to install rasa-webchat

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 ]

Block user from writing until a response form the chatbot

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?

message handler error

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

How to run this widget

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

Npm test in bitbucket pipelines : SyntaxError: Unexpected identifier "Import"

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

Retrieving customData in core actions

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:

  • Extract senderId from rasa-webchat component in react frontend and attach this id to the user in the database.
  • Supply custom 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.

Changing Client-Side JavaScript

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?

Strong text (** in md) does not appear strong

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; */
}

Video/Image Not Showing

Hi there! I'm trying to send a video/image to the chat UI from Rasa but this is what i'm getting:

screen shot 2018-12-16 at 2 51 48 pm

This is a snippet of my actions.py code:
screen shot 2018-12-16 at 2 53 30 pm

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!

Conditional behavior based on conversation history

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

On the widget side:

An array of widget_events 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.

Sending widget_events 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

CORS error connection to RASA running on Docker

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:

  • "*"
    pipeline: "spacy_sklearn"`

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

Waiting for server...

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

Show Typing dots when user wait ...

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...

Unable to use Widget Component

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

Rasa-webchat widget appears to connect to rasa server, but keeps saying "Waiting for server..."

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!

UI is just a blank screen

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!

Chat window running a custom Action on opening

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

Installation error for rasa-webchat

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

HTML table

Folks, can I send a html table as message? It is rendering as plain text.

Thanks
Emannuel Roque

No 'Access-Control-Allow-Origin' header is present on the requested resource.

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

Buttons disappear immediately, if another message from the bot follows

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..." 

Persistent sessions across pages

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:

Session id

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:

  • if the client has a core session stored locally, it attaches it to the socket (e.g. socket.userId = localStorage.get(...)) so when a message is emitted the server can map it to the correct stored conversation.
  • if the client has no core session stored locally, then the server won't find the 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 changes

A 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.

Local storage

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.

config

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/

Stuck in "Waiting for server..."

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!

Send response in raw HTML

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.