Skip to main content

dTelecom voice agents for Python

Build a Python voice agent that listens and speaks in a dTelecom room. The agent uses the dTelecom server SDK for Cloud grants and speech sessions, and the Python RTC SDK for room audio and data.

Install the package with its LLM integration and set DTELECOM_CLOUD_URL, DTELECOM_API_KEY, DTELECOM_API_SECRET, and OPENROUTER_API_KEY. Run the voice agent example from the agents/ directory of this checkout. It takes one room name. Have a second participant join the same project and room with its own grant.

python -m pip install 'dtelecom-agents[llm]'
python examples/voice_agent.py my-room

Use DTelecomSTT and DTelecomTTS for dTelecom speech. Choose OpenRouterLLM or OpenAILLM, or implement the asynchronous LLMPlugin interface. The optional memory extra adds a local embedding model for persistent, scoped room memory. The model downloads on first use.

A participant can interrupt the agent while it is speaking. Subscribe to the transcription, response, interrupted, and metrics events to update your application. An interim result carries the speaker, utterance ID and revision. Final text drives the LLM. Tool handler timeouts use seconds and latency metrics use milliseconds.

For an already issued room grant, supply token, ws_url and fallback_urls to agent.start(). A speech connection still needs separate speech credentials. For gateway speech grants, supply the issued server URL, single-use key and renewal callback to SpeechCredentials. The Cloud and gateway use their respective credential types.

Tools and conversation controls

Define tools with JSON Schema. An asynchronous handler returns a string or JSON-serializable value to the model. The runtime cancels the handler when the user interrupts the turn. A tool supplied as a plain definition emits tool_call for application-managed handling.

from dtelecom_agents import AgentTool

async def next_opening(arguments, context):
    return {"next_opening": "Tuesday at 09:00"}

schedule = AgentTool(
    definition={
        "type": "function",
        "function": {
            "name": "next_opening",
            "description": "Get the next appointment time.",
            "parameters": {"type": "object", "properties": {}},
        },
    },
    handler=next_opening,
    timeout=10,
)

Pass tools=[schedule] to VoiceAgent. For an addressed assistant in a group room, use respond_mode="addressed", agent_name="assistant" and name_variants=["helper"]. A before_respond(speaker, text) hook can refine that decision. Each participant has its own recognition stream. A callback registered as agent.on("transcription", callback) receives (speaker, result).

Use await agent.say(text) for a greeting and await agent.say_ssml(document, display_text) for a complete SSML document. Language-specific voices can be configured with VoiceConfig(voice, lang_code). Set watermark=True on DTelecomTTS to request watermarking and partials=True, smart_turn=True on DTelecomSTT to request provisional text and server turn detection. The stt_ready event carries the server's effective Smart Turn state.

Optional memory

Install dtelecom-agents[memory] and pass memory=MemoryConfig(db_path="data/assistant.db") using from dtelecom_agents.memory import MemoryConfig. Turns and summaries are scoped to the room by default. Set a separate scope when your application intentionally shares history across rooms. Session text and embeddings are stored locally. To supply an already downloaded model, construct Embedder(model_dir=...) in a RoomMemory instance.

Python's standard logging controls diagnostics. To capture synthesized speech explicitly, call agent.enable_audio_dump(directory); recordings are written as local 48 kHz mono WAV files.

Metadata

Release files for dtelecom-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)

Source distribution for dtelecom-agents 0.1.1
File Size Uploaded Provenance Actions
dtelecom_agents-0.1.1.tar.gz 28.0 kB With provenance Details for dtelecom_agents-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dtelecom-agents 0.1.1
File Interpreter ABI Platform Actions
dtelecom_agents-0.1.1-py3-none-any.whl Python 3 none any Details for dtelecom_agents-0.1.1-py3-none-any.whl

Total release size: 56.7 kB

Release files / dtelecom_agents-0.1.1.tar.gz

Download URL dtelecom_agents-0.1.1.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
84f6d9050c27dac436fc77bed5856f8a5ec612143d8cf6eedfdd6a2ae309d7be
BLAKE2b-256 checksum
How to use checksums
4b734aa259a77106d0d6fb2962c39e6ceee3380278d6a07655c6bd8da1fe5b9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / dtelecom_agents-0.1.1-py3-none-any.whl

Download URL dtelecom_agents-0.1.1-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a65bdb90420570ca96d38acddb7d06bb97f55790d2b58161c899e6e5072fdbf
BLAKE2b-256 checksum
How to use checksums
acf24db50526df2fbdfc3fd3453c7b398d454ca9a9c1bdba1df9a930c97db8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for dtelecom-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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dtelecom_agents-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

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.1 This release

2 release files Full 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