Skip to content

Commit

Permalink
Patch 2 (#17)
Browse files Browse the repository at this point in the history
* Update README.md

* Update .env.example

* Update server.py

* Update app.json

* Update README.md

* Update README.md

* Update README.md

* Create heroku

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update app.json

* Update heroku

* Update README.md

* Added section "Interacting with Lex"

* Updated redirect link
  • Loading branch information
tchan408 authored Oct 8, 2020
1 parent 6db8a79 commit 49237b5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
5 changes: 1 addition & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
# PUBLIC HOSTNAME:
HOSTNAME=example.ngrok.io

# PORT:
PORT=5000
PORT=5000
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lex Connector

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](http://nexmo.dev/lex-connector-heroku)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Nexmo/lex-connector/heroku)

You can use the Lex Connector to connect a Vonage Voice API call to a Lex bot and then have an audio conversation with the bot.

Expand Down Expand Up @@ -85,7 +85,7 @@ Start by copying the `.env.example` file over to a new file called `.env`:
cp .env.example > .env
```

Modify the contents of the file to include your own `HOSTNAME` and `PORT`. You can then launch the Lex Connector as a Docker instance by running:
Edit `.env` file, set the `PORT` value where websockets connections will be established. You can then launch the Lex Connector as a Docker instance by running:

```bash
docker-compose up
Expand Down Expand Up @@ -116,11 +116,12 @@ To run your own instance locally you'll need an up-to-date version of Python 3.
pip install --upgrade -r requirements.txt
```

Copy the `.env` example over to a new file and replace the contents with your own `HOSTNAME` and `PORT`
Copy the `.env.example` file over to a new file called `.env`.

```bash
cp .env.example > .env
```
Edit `.env` file, set the `PORT` value where websockets connections will be established.

The port is internal to you - LexConnector assumes the service can be accessed via the default port (80/443) on the hostname you provide, with something like NGinx proxying to the port you've provided.

Expand All @@ -137,3 +138,7 @@ python server.py
```

The WebSocket URL you use in your NCCO should use the hostname of your service wherever it is running, and if you don't have SSL set up, you'll need to change the `wss` prefix to `ws`.

### Interacting with Lex

Call the phone number linked to your VAPI (Voice API application). What you say at the beginning depends on how the Lex bot has been set up, i.e. the Welcome intent has a few programmed utterances, you would say one of those utterances.
16 changes: 13 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "Lex Connector - Connect Vonage Calls to AWS Lex bots",
"description": "The Lex Connector allows a Vonave Voice API call to be connected to any AWS Lex bot. This is the bridge between voice and the bot functionality that allows users to 'talk' directly with a bot.",
"name": "Lex Connector - Connect Vonage calls to AWS Lex bots",
"description": "The Lex Connector allows a Vonage Voice API call to be connected to any AWS Lex bot. This is the bridge between voice and the bot functionality that allows users to 'talk' directly with a bot.",
"keywords": ["lex", "bot", "python", "amazon web services", "vonage"],
"website": "https://developer.nexmo.com/extend/amazon-lex-connector",
"repository": "https://github.com/Nexmo/lex-connector"
"repository": "https://github.com/Nexmo/lex-connector",
"env":{
"NAME": {
"description": "The Heroku app name"
}
},
"buildpacks": [
{
"url": "heroku/python"
}
]
}
5 changes: 5 additions & 0 deletions heroku
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<html>
<body>
You are being <a href="https://heroku.com/deploy?template=https://github.com/Nexmo/lex-connector">redirected</a>
</body>
</html>
3 changes: 1 addition & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
# Global variables
conns = {}

# Environment Variables, these are set in .env locally
HOSTNAME = os.getenv("HOSTNAME")
# Environment variables, these are set in .env locally
PORT = os.getenv("PORT")


Expand Down

0 comments on commit 49237b5

Please sign in to comment.