Skip to main content

A FastAPI router + Twilio⇆OpenAI realtime streaming helper

Project description

awesome_caller_boi

A small Python package that exposes a FastAPI router to connect Twilio’s voice streaming directly to the OpenAI realtime API (GPT-4o). It handles incoming calls, establishes the WebSocket media stream with Twilio, forwards audio to OpenAI, and sends back OpenAI’s audio response to the caller.

Features

  • Provides a FastAPI router for Twilio voice webhooks.
  • Streams inbound audio from Twilio to OpenAI in real time.
  • Encodes and forwards OpenAI’s audio responses back to Twilio.
  • Automatically handles speech interruptions (caller starts speaking mid-response).
  • Easy to configure with your own get_system_message() and get_system_greeting() callbacks.
  • Put your OpenAi key in your enviornment variables and call it OPENAI_API_KEY

Installation

From PyPI (once published):

pip install awesome_caller_boi

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awesome_caller_boi-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awesome_caller_boi-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file awesome_caller_boi-0.1.0.tar.gz.

File metadata

  • Download URL: awesome_caller_boi-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for awesome_caller_boi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 62db94ae0fe7b4140436a73d77bdd5493076962f00bdd87378d5ca009c82d737
MD5 63e260e18554ce1811585066e162cbe6
BLAKE2b-256 b6fa9f2b523af049bb39aa420fa53fe6770a5faa8411e0b36bc0c72911f7cf97

See more details on using hashes here.

File details

Details for the file awesome_caller_boi-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for awesome_caller_boi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6b068d43ebb9bc26d359b10e60d41a8e85965a9ff80867fcb1886bfc6c10051
MD5 97e443a4d4397767318cc40e7066e8ab
BLAKE2b-256 ce4c25e4c6a5853377d9ba8d1621ab7460b9c1051aa895c5511ae192b64b755d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page