elizabethsiegle / chatGPT-SMS-js

ChatGPT over SMS using Twilio Programmable Messaging, Twilio Serverless Toolkit, OpenAI API, Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chatGPT-SMS

Use ChatGPT without the browser! Text +17622490430. image

You'll need an OpenAI API Key. You can get one here by clicking on + Create new secret key. image

Set an Environment Variable with Twilio Functions and Assets

Open up your .env file for your Functions project in your root directory and add the following line:

OPENAI_API_KEY=YOUR-OPENAI-API-KEY

Now you can access this API Key if you'd like to do so in your code with context.OPENAI_API_KEY.

Configure the Serverless Function with a Twilio Phone Number

To open up our app to the web with a public-facing URL, run twilio serverless:deploy from the root directory. image Grab the Function URL corresponding to your app (the one that ends with /chatgpt) and configure a Twilio phone number with it as shown below: select a Twilio number you purchased in your Twilio phone numbers console and scroll down to the Messaging section. Paste the link in the text field for A MESSAGE COMES IN webhook making sure that it's set to HTTP POST. When you click Save it should look like this! image

Now take out your phone and text a question or prompt to your Twilio number. image

About

ChatGPT over SMS using Twilio Programmable Messaging, Twilio Serverless Toolkit, OpenAI API, Node.js


Languages

Language:HTML 58.8%Language:CSS 21.5%Language:JavaScript 19.6%