Skip to content

Commit da9ed45

Browse files
authored
Merge pull request #2 from obvonage/main
Create .env
2 parents 8ac5c2e + 5f4fbd5 commit da9ed45

File tree

5 files changed

+80
-0
lines changed

5 files changed

+80
-0
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
API_KEY=
2+
API_SECRET=
3+
OPENAI_API_KEY=
4+
EVENT_URL=

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,84 @@
11
## Integrate Phone Calls and SMS with OpenAI
22

3+
Full workflow here [https://developer.vonage.com/en/blog/integrate-phone-calls-and-sms-with-openai](https://developer.vonage.com/en/blog/integrate-phone-calls-and-sms-with-openai)
4+
35
We've already developed a starter Vonage Voice application to receive a call, catch your response, and send it to a 3rd party (OpenAI).
46
Users can deploy the App using Github Codespaces.
57
Fork [this repository](https://github.com/Vonage-Community/tutorial-voice-messages-node-openai-integration). Open it in Codespaces by clicking "Create codespace on main"
68

79
![Create Codespace interface](codespaces.png)
810

11+
## Create a new Vonage app
12+
In the left menu [here](https://dashboard.nexmo.com/), click API Settings, left menu item.
13+
14+
![API Settings](settings.png)
15+
16+
Copy and paste in the `.env` file API key and API Secret
17+
18+
```
19+
API_KEY=b**********
20+
API_SECRET=******************
21+
```
22+
23+
**OpenAI API**
24+
25+
After [registering](https://beta.openai.com/signup) and confirming your phone number, you need to generate your [API key](https://beta.openai.com/account/api-keys).
26+
27+
With this API key, we can move forward.
28+
29+
Paste it to your `.env` file
30+
31+
```
32+
API_KEY=b**********
33+
API_SECRET=******************
34+
OPENAI_API_KEY=sk-**************************************
35+
```
36+
37+
## Deploy Our App in Codespace
38+
39+
Open GitHub Codespace in your fork.
40+
41+
In the Codespace terminal, run the following command to install our Node packages:
42+
43+
```
44+
npm install
45+
```
46+
47+
Run the following command in the terminal to receive the GitHub Codespace URL for webhooks
48+
49+
```
50+
echo "https://${CODESPACE_NAME}-3000.preview.app.github.dev/webhooks/asr"
51+
```
52+
53+
Copy and paste the output in `EVENT_URL=` in the `.env` file
54+
55+
```
56+
API_KEY=b**********
57+
API_SECRET=******************
58+
OPENAI_API_KEY=sk-**************************************
59+
EVENT_URL=https://******************************************-3000.preview.app.github.dev/webhooks/asr
60+
```
61+
62+
Update App settings using [Dashboard](https://dashboard.nexmo.com/). Go to Application in the left menu. Choose a related app and click the 'Edit' button
63+
64+
![Edit App](edit-app-urls.png)
65+
66+
Run the App
67+
68+
```bash
69+
node index.js
70+
```
71+
72+
In the terminal, open the `Port` tab. Click on `Private` in the `Visibility` column, and change it to `Public`.
73+
74+
![codespace port public](codespace-port-public.png)
75+
76+
Everything is ready
77+
78+
* Try this out by calling the number that is linked with the app `**732**56**`
79+
* Tell the bot your tip
80+
* Wait for the content in the corresponding messenger
81+
* Monitor the console
82+
83+
84+

codespace-port-public.png

435 KB
Loading

edit-app-urls.png

142 KB
Loading

settings.png

463 KB
Loading

0 commit comments

Comments
 (0)