Skip to content

elizabethsiegle/predict-bball-shot-sms-gpt4v

Repository files navigation

Shot predictor via SMS with GPT-4V

SMS example Predict whether a basketball shot went in or not via SMS using GPT-4V. You'll need

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

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. deploy function from terminal

Grab the Function URL corresponding to your app (the one that ends with /sms-gpt4v) 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! Configure Twilio number with Function Now take out your phone and text a question or prompt to your Twilio number.