Giter Club home page Giter Club logo

tutorial-voice-messages-node-openai-integration's Introduction

Integrate Phone Calls and SMS with OpenAI

Full workflow here https://developer.vonage.com/en/blog/integrate-phone-calls-and-sms-with-openai

We've already developed a starter Vonage Voice application to receive a call, catch your response, and send it to a 3rd party (OpenAI). Users can deploy the App using Github Codespaces. Fork this repository. Open it in Codespaces by clicking "Create codespace on main"

Create Codespace interface

Create a new Vonage app

In the left menu here, click API Settings, left menu item.

API Settings

Copy and paste in the .env file API key and API Secret

API_KEY=b**********
API_SECRET=******************

OpenAI API

After registering and confirming your phone number, you need to generate your API key.

With this API key, we can move forward.

Paste it to your .env file

API_KEY=b**********
API_SECRET=******************
OPENAI_API_KEY=sk-**************************************

Deploy Our App in Codespace

Open GitHub Codespace in your fork.

In the Codespace terminal, run the following command to install our Node packages:

npm install

Run the following command in the terminal to receive the GitHub Codespace URL for webhooks

echo "https://${CODESPACE_NAME}-3000.preview.app.github.dev/webhooks/asr" 

Copy and paste the output in EVENT_URL= in the .env file

API_KEY=b**********
API_SECRET=******************
OPENAI_API_KEY=sk-**************************************
EVENT_URL=https://******************************************-3000.preview.app.github.dev/webhooks/asr

You will need to provide an answer URL for the application you create that corresponds to the answer route provided in the .env file. The answer URL needs to be an externally accessible URL that ends with /webhooks/answer. For example, if your URL was example.com, then your answer URL would be http://example.com/webhooks/answer.

Update App settings using Dashboard. Go to Application in the left menu. Choose a related app and click the 'Edit' button

Edit App

Run the App

node index.js

In the terminal, open the Port tab. Click on Private in the Visibility column, and change it to Public.

codespace port public

Everything is ready

  • Try this out by calling the number that is linked with the app **732**56**
  • Tell the bot your tip
  • Wait for the content in the corresponding messenger
  • Monitor the console

tutorial-voice-messages-node-openai-integration's People

Contributors

obvonage avatar ruskibenya avatar superchilled avatar

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.