Skip to content

An experiment in using Open AI to generate Twilio code

Notifications You must be signed in to change notification settings

TwilioDevEd/Twiliomatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twiliomatic

A TwiML generator using GPT-3 from OpenAI

Setup

brew tap twilio/brew && brew install twilio
twilio plugins:install @twilio-labs/plugin-serverless

Setup your environment

From the root of your repository

npm install
npx configure-env

Develop locally

twilio serverless:start

Deploy to dev

twilio serverless:deploy

Deploy to prod

twilio serverless:deploy --production

The main interface currently lives at /index

Use the output from your deploys to locate the full url.

It will look something like:

https://twiliomatic-9999-dev.twil.io/index

Where 9999 is unique to your deploy and environment.

Scripts

change-mode

Provides the ability to change modes by environment. keynote for when it airs. shutdown to turn things off.

npm run change-mode --mode=keynote --env=production
npm run change-mode --mode=shutdown --env=dev

set-favorites

Update the shutdown mode favorites. Value is comma separated

npm run set-favorites --gists=ABC123,DEF456 --env=production

delete-all-gists

Removes all gists for the GITHUB_USER

npm run delete-all-gists

purge-cache

Purges cache for Cloudflare Zone CLOUDFLARE_ZONE_ID

npm run purge-cache

Overview

The OpenAI prompts are defined in twiml-prompts

/mode

Returns an object that helps to detect the current state of things

{
  "mode": "keynote",
  "enabled": true
}

/requester

Allows for a long running query through the use of Sync.

Parameter Description
Query (Required intiially) The prompt you'd like to complete
ID The ID of the request delivered after the initial Query is ran

See client side long-query.js and it's usage

Tests

There are not too many 😢

npm test

About

An experiment in using Open AI to generate Twilio code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published