Skip to content

Commit

Permalink
added images, made readme more comprehensive
Browse files Browse the repository at this point in the history
  • Loading branch information
mohdsanadzakirizvi committed Apr 24, 2019
1 parent 6449fb4 commit 9443fe7
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 2 deletions.
59 changes: 58 additions & 1 deletion complete_version/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipeline: spacy_sklearn
- **endpoints.yml** file contains the webhook configuration for custom action.
- **policies.yml** file contains the configuration of the training policies for Rasa Core model.
## How to run
## How to run locally
**Note**: If running on Windows, you will either have to [install make](http://gnuwin32.sourceforge.net/packages/make.htm) or copy the following commands from the [Makefile](https://github.com/RasaHQ/starter-pack-rasa-stack/blob/master/Makefile)
Expand All @@ -53,3 +53,60 @@ This will start the server for emulating the custom action.
4. Test the assistant by running:
```make cmdline```
This will load the assistant in your terminal for you to chat.

## How to deploy to Slack

1. Go to your Slack app's settings page and use the **Bot User OAuth Access Token:**
![](../images/bot_token.png)
And add this in the **slack_credentials.yml** file:

```python
slack:
slack_token: "Bot User OAuth Access Token"
slack_channel:
```

2. Start the action server by typing the following command in terminal:

```
make action-server
```

3. Setup ngrok for the port that the action server is using by the following command:

```
ngrok http 5055
```

This will give you an output like the following:
![](../images/ngrok_action.png)

4. Copy the highlighted url in the above image into your **endpoints.yml** file:

```python
action_endpoint: "your_url_here/webhook"
url:
```

5. Start the core server in another terminal window:

```
python -m rasa_core.run -d models/current/dialogue -u models/current/nlu --port 5002 --connector slack --credentials slack_credentials.yml --endpoints endpoints.yml
```

This will start the server at port 5002.

6. Now you have to expose this port to the world by using ngrok, open another terminal and type:

```
ngrok http 5002
```

7. Take the above url and paste it into the **Events Subscription** page of your slack app in the following format:

```
your_url_here/webhooks/slack/webhook
```

![](../images/event_subs.png)
And you should now be able to talk to your chatbot in Slack!
Binary file added images/bot_token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/event_subs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ngrok_action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 58 additions & 1 deletion practice_version/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pipeline: spacy_sklearn
- **endpoints.yml** file contains the webhook configuration for custom action.
- **policies.yml** file contains the configuration of the training policies for Rasa Core model.
## How to run
## How to run locally
**Note**: If running on Windows, you will either have to [install make](http://gnuwin32.sourceforge.net/packages/make.htm) or copy the following commands from the [Makefile](https://github.com/RasaHQ/starter-pack-rasa-stack/blob/master/Makefile)
Expand All @@ -53,3 +53,60 @@ This will start the server for emulating the custom action.
4. Test the assistant by running:
```make cmdline```
This will load the assistant in your terminal for you to chat.

## How to deploy to Slack

1. Go to your Slack app's settings page and use the **Bot User OAuth Access Token:**
![](../images/bot_token.png)
And add this in the **slack_credentials.yml** file:

```python
slack:
slack_token: "Bot User OAuth Access Token"
slack_channel:
```

2. Start the action server by typing the following command in terminal:

```
make action-server
```

3. Setup ngrok for the port that the action server is using by the following command:

```
ngrok http 5055
```

This will give you an output like the following:
![](../images/ngrok_action.png)

4. Copy the highlighted url in the above image into your **endpoints.yml** file:

```python
action_endpoint: "your_url_here/webhook"
url:
```

5. Start the core server in another terminal window:

```
python -m rasa_core.run -d models/current/dialogue -u models/current/nlu --port 5002 --connector slack --credentials slack_credentials.yml --endpoints endpoints.yml
```

This will start the server at port 5002.

6. Now you have to expose this port to the world by using ngrok, open another terminal and type:

```
ngrok http 5002
```

7. Take the above url and paste it into the **Events Subscription** page of your slack app in the following format:

```
your_url_here/webhooks/slack/webhook
```

![](../images/event_subs.png)
And you should now be able to talk to your chatbot in Slack!

0 comments on commit 9443fe7

Please sign in to comment.