Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 943 Bytes

File metadata and controls

29 lines (25 loc) · 943 Bytes

Ruby Twilio OpenAI Realtime Example

This is an example Rack server demonstrate bi-directional asynchronous streaming in ruby using websockets. We use the falcon server and the async gem.

Setup

Add your OpenAI API key to the .env file.

OPENAI_API_KEY=abcdefghijklexample
HOST=example.ngrok.com

Then run

bin/server

You'll need to set up your twilio webhooks to point to your server. If you're on a local dev machine then you can use NGrok to connect your localhost to a public url.

ngrok http localhost:9292

Twilio Dev Phone

Twilio provide a brilliant application called dev phone for testing calling numbers using your web browser. Install the Twilio CLI. Then run the following command:

twilio dev-phone