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. The runnable example 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.0
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 |
|---|---|---|---|---|
| dtelecom_agents-0.1.0.tar.gz | 27.9 kB | With provenance | Details for dtelecom_agents-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtelecom_agents-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for dtelecom_agents-0.1.0-py3-none-any.whl |
Total release size: 56.5 kB
Release files / dtelecom_agents-0.1.0.tar.gz
| Download URL | dtelecom_agents-0.1.0.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0af01614314a88a75a5717f8d640feaad77469255865d6b198f2f597d288a3a5
|
|
BLAKE2b-256 checksum How to use checksums |
11d948058c18574b11290268325aad8b49b14b015ff854c24802d6e68ba65acf
|
| 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 logRelease files / dtelecom_agents-0.1.0-py3-none-any.whl
| Download URL | dtelecom_agents-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4985b21afca4a5c865268b597066aaf4ece15d2c4d7ecf6e9aec48d55ee95c0b
|
|
BLAKE2b-256 checksum How to use checksums |
4d72b197347546ff6d00e11089af096d0bf0b990e690c6dfa1db98f6de39c745
|
| 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 logSecurity for dtelecom-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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dtelecom_agents-0.1.0.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 logA 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.