A FastAPI server that acts as a TwiML voice agent
Project description
Warning: this file needs updating
twiml-voice-agents
Why Use twiml-voice-agents
Configuring an agent is fairly simple and easy.
Limitations
The twiml-voice-agents package is limited by the fact that it supports half-duplex communication.
Half-duplex means that both a caller and the agent can speak, but only one at a time. The caller can interrupt the agent (technical name for this is barge-in). However, due to the nature of TwiML apps, there is a time when caller input will be lost. That period begins when Twilio detects an end-of-turn for the caller and awaits a response from your twiml-voice-agents server.
Minimal Usage
Installing
Run python3 -m pip install twiml-voice-agents
Setup
Anthropic
Get an Anthropic API key.
Set the ANTHROPIC_API_KEY environment variable to your API key.
Square
Get a Square OAuth Token with the following permissions: ...
Set the SQUARE_ACCESS_TOKEN environment variable to your OAuth token
Ngrok
Get an ngrok token
Set the NGROK_AUTHTOKEN environment variable to your auth token
Twilio Telephony
Set up a Twilio phone number to handle incoming calls with a TwiML webhook of your choice.
Set the webhook URL to the ngrok domain along with path /call.
Set the HTTP method to POST.
Running Server
import twiml_voice_agents as tva
srvr = tva.Server(tva.SquareSchedulingAgent)
srvr.run()
Talking to Agent, Finally
Lastly, call the Twilio phone number you configured.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twiml_voice_agents-0.1.8.tar.gz.
File metadata
- Download URL: twiml_voice_agents-0.1.8.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
926edcdbe19cf306ec717d9812096aabd21d23a6c42dcc1fa7e648b8ebd7dd29
|
|
| MD5 |
171557aabb2285d97147b2d33bbd6bb7
|
|
| BLAKE2b-256 |
f2877e913c34598b1222ab07d67e0036cddf2c7e42283679ca9b168e7e717501
|
Provenance
The following attestation bundles were made for twiml_voice_agents-0.1.8.tar.gz:
Publisher:
publish.yml on Peter-Bergman/twiml-voice-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twiml_voice_agents-0.1.8.tar.gz -
Subject digest:
926edcdbe19cf306ec717d9812096aabd21d23a6c42dcc1fa7e648b8ebd7dd29 - Sigstore transparency entry: 2014996752
- Sigstore integration time:
-
Permalink:
Peter-Bergman/twiml-voice-agents@d7b014b998c07b236ad12ccbc8e575dc189ddab7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Peter-Bergman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7b014b998c07b236ad12ccbc8e575dc189ddab7 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file twiml_voice_agents-0.1.8-py3-none-any.whl.
File metadata
- Download URL: twiml_voice_agents-0.1.8-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
088e92a462eec8b2e5ce9cd14e65110e99f733c5f7db76fac772ab7af7286dbf
|
|
| MD5 |
2746cad3706eeb08deff568ebeccb239
|
|
| BLAKE2b-256 |
a96fc3915cc315062c33243830d185dcd3cb6ee2b3a73fac6783ea1e3c8af053
|
Provenance
The following attestation bundles were made for twiml_voice_agents-0.1.8-py3-none-any.whl:
Publisher:
publish.yml on Peter-Bergman/twiml-voice-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twiml_voice_agents-0.1.8-py3-none-any.whl -
Subject digest:
088e92a462eec8b2e5ce9cd14e65110e99f733c5f7db76fac772ab7af7286dbf - Sigstore transparency entry: 2014996968
- Sigstore integration time:
-
Permalink:
Peter-Bergman/twiml-voice-agents@d7b014b998c07b236ad12ccbc8e575dc189ddab7 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Peter-Bergman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d7b014b998c07b236ad12ccbc8e575dc189ddab7 -
Trigger Event:
workflow_dispatch
-
Statement type: