Sent Voice Agents for Python
An AI agent that takes and places phone calls through Sent, on the Sent Voice Agents protocol 0.2.0.
Status: Preview, with the protocol. Generated and rendered by sent-dm-sdk-pipeline from the protocol at
v0.2.0; every release passes the protocol's conformance scenarios in CI.
Read the Voice Agents docs to get started.
Install
pip install sentdm-voice-agents
Python 3.11 or later. The one dependency is websockets.
Quickstart
from sentdm_voice_agents import Agent, Session
class Support(Agent):
async def on_session_start(self, session: Session) -> None:
await session.say("Hi, this is Acme support. How can I help?")
async def on_user_said(self, session: Session, said) -> None:
if "person" in said.text:
await session.say("Transferring you now.")
await session.transfer("+14155550100")
else:
await session.say(f"You said {said.text}")
Support(api_key="sk_live_...", agent_id="agent_...").serve()
serve() connects to Sent with the account API key and serves calls until SIGINT or SIGTERM; await agent.run() does the same inside your own event loop. Each session's handlers run in order on their own task,
so sessions never wait for one another. The runtime answers heartbeats, opens a new connection when one drains
or is lost, and resumes the sessions that can move; the handlers only see calls.
| Handler | When |
|---|---|
on_session_start(session) |
A call reached the agent. In a text session, say() to speak |
on_user_said(session, said) |
Text sessions: the caller said something; said.correction means it replaces the previous one |
on_audio(session, samples) |
Audio sessions: the caller's audio, 16-bit mono PCM at session.sample_rate |
on_tool_result(session, result) |
Sent answered a tool call; the awaiting call gets the same result |
on_session_end(session, end) |
The call left the agent; end.reason says why |
on_session_lost(session) |
The connection was lost and the session could not be resumed |
On a Session: say(text, last=True, interruptible=True), clear(), send_audio(samples), and the tools
transfer(to), hangup(), send_dtmf(digits), hold(held), each returning Sent's ToolResult. session.from_,
to, direction, session_type, language, context, sample_rate carry what session.start said.
sentdm_voice_agents.frames holds every frame as a type, with decode() and encode() that check the
protocol's rules; it is generated from the protocol and not edited by hand.
Develop
uv sync # the package and its test dependencies
uv run pytest # the runtime and the frames against the protocol's fixtures
The conformance scenarios run in CI through the protocol's action, against python -m sentdm_voice_agents.conformance.
Releases are cut by release-please from main and published to PyPI from GitHub Actions.
Metadata
Release files for sentdm-voice-agents 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sentdm_voice_agents-0.1.1.tar.gz | 31.9 kB | Without provenance | Details for sentdm_voice_agents-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sentdm_voice_agents-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for sentdm_voice_agents-0.1.1-py3-none-any.whl |
Total release size: 57.8 kB
Release files / sentdm_voice_agents-0.1.1.tar.gz
| Download URL | sentdm_voice_agents-0.1.1.tar.gz |
|---|---|
| Size | 31.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8a33101fc354cdcf4495be6d1de71a6f2dd1640150b7820411a67758adbeb66
|
|
BLAKE2b-256 checksum How to use checksums |
e2899abb0b2bb5a482c3c87d5bdb56f1615243ec44983606560fe58f13ccca3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sentdm_voice_agents-0.1.1-py3-none-any.whl
| Download URL | sentdm_voice_agents-0.1.1-py3-none-any.whl |
|---|---|
| Size | 25.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47356c1d10f8d6205630106963961b48940143a0e1b10a30be002acc4bb9f6de
|
|
BLAKE2b-256 checksum How to use checksums |
972d59716ce6cd80cf001011aa7e85c9ec15d60089a2bc5a827d1b61976b7606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for sentdm-voice-agents 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.