Skip to main content

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentdm-voice-agents 0.1.0
File Size Uploaded Provenance Actions
sentdm_voice_agents-0.1.0.tar.gz 29.9 kB Without provenance Details for sentdm_voice_agents-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sentdm-voice-agents 0.1.0
File Interpreter ABI Platform Actions
sentdm_voice_agents-0.1.0-py3-none-any.whl Python 3 none any Details for sentdm_voice_agents-0.1.0-py3-none-any.whl

Total release size: 54.8 kB

Release files / sentdm_voice_agents-0.1.0.tar.gz

Download URL sentdm_voice_agents-0.1.0.tar.gz
Size 29.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b993c011d12cee4ee4867f0c0cf049742c89f3ddd70cff3fbb2290113776e6c
BLAKE2b-256 checksum
How to use checksums
42442ce388a121c5baa9dea058a125c62c5f5ed3940e1e962b1eb23289c866ff
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.0-py3-none-any.whl

Download URL sentdm_voice_agents-0.1.0-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1f721388e9d07566a82c1722dc795c0fc0cafdf07d318c1834b14b4bdf118d8
BLAKE2b-256 checksum
How to use checksums
7de81d6d93d5d7a310a03f565ab920714e4769388fd4cc9af4577f31ab00d560
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.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page