Skip to main content

voicelayer-agents

VoiceLayer channels for the Python agent framework you already use: SMS, WhatsApp, Telegram, Discord and email, for the Claude Agent SDK, the OpenAI Agents SDK and LangChain/LangGraph.

  • Tool packs — VoiceLayer's channel tools (message_send, message_reply, conversations_list, conversation_read, conversation_set_controller, messages_wait, channels_list, whatsapp_templates_list) in each framework's own MCP hook. The VoiceLayer MCP server lists them; nothing is re-implemented here.
  • serve_direct — direct mode, with any framework: your process answers the conversations handed to code (controller api). Your runner gets the message and the conversation's history and returns the reply; it is sent once, through every gate of the pipeline (the Output Guard included — a refusal goes to on_refused, never retried around).
pip install voicelayer-agents              # serve_direct and the test-mode helper
pip install "voicelayer-agents[openai]"    # + the OpenAI Agents tool pack; also [claude], [langgraph]

Each framework is an extra, pinned to the version the tests run. Direct mode is built on the generated API client, voicelayer, installed with it.

Keys

Set VOICELAYER_API_KEY to a workspace API key (dashboard -> API keys) scoped to what the agent does: messages:send, messages:read, conversations:control, events:read, channels:read. Every helper reads it, and VOICELAYER_API_URL (default https://api.vlayers.ai), so the examples below pass nothing. api_key= and base_url= override both. A test key (vl_test_...) runs everything in test mode: every send goes through the loopback and costs nothing, and a workspace with no number gets a free test sender. A worker key (vlw_...) is refused.

Tool packs

import asyncio

from agents import Agent, Runner
from voicelayer_agents.openai import voicelayer_mcp_server


async def main():
    async with voicelayer_mcp_server() as voicelayer:  # connected; closed afterwards
        agent = Agent(name="support", instructions="You answer customers in one short sentence.", mcp_servers=[voicelayer])
        print((await Runner.run(agent, 'Text "Hello from VoiceLayer" to +15550101 over sms.')).final_output)


asyncio.run(main())
from claude_agent_sdk import ClaudeAgentOptions
from voicelayer_agents.claude import voicelayer_mcp

options = ClaudeAgentOptions(**voicelayer_mcp(), tools=[], system_prompt="You answer customers in one short sentence.")
from langgraph.prebuilt import create_react_agent
from voicelayer_agents.langgraph import voicelayer_tools

agent = create_react_agent("openai:gpt-4.1-mini", await voicelayer_tools())  # inside an async function

Direct mode

from voicelayer_agents import DirectAnswer, serve_direct


def answer(turn):
    # turn.message: the inbound (id, channel, conversation_id, text); turn.history: the conversation, oldest first
    if "person" in turn.message.text.lower():
        return DirectAnswer(text="Passing you to a colleague.", handoff="asked for a person")
    return f"You said: {turn.message.text}"


serve_direct(answer).wait()  # answers until Ctrl+C

serve_direct returns once its place in the event stream is fixed: every message that arrives after it returns is answered. .wait() blocks (a program that only calls serve_direct would exit at once); .stop() or a with block ends it. Pass after= to resume from a saved cursor, channels= to narrow, history=False (or your own callable) to skip the history read.

Test mode

from voicelayer_agents import simulate_inbound

# a person writing to the workspace, simulated (test keys only): sms, from +15550101 unless you pass channel= / from_=
simulate_inbound("Are you open?")

Guides: vlayers.ai/docs/agents. The TypeScript twin is @voicelayer/agents. Licence: Apache-2.0.

Metadata

Release files for voicelayer-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 voicelayer-agents 0.1.0
File Size Uploaded Provenance
voicelayer_agents-0.1.0.tar.gz 17.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for voicelayer-agents 0.1.0
File Interpreter ABI Platform
voicelayer_agents-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.6 kB

Release files / voicelayer_agents-0.1.0.tar.gz

Download URL voicelayer_agents-0.1.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f902cd83bf59b9107a45064d1d4c455860a75b09f2bcd2c4c5ca17e306b9f1a5
BLAKE2b-256 checksum
How to use checksums
b2d40e7413ebe83d1006407a10f6a2a6e20d19b2cac81feac79ed8d74b699ef5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 21, 2026.

Transparency log

Release files / voicelayer_agents-0.1.0-py3-none-any.whl

Download URL voicelayer_agents-0.1.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3c470d0897818a187250791ce4620d2a2e417e1f35d98532b92ed74bb6b9a8e
BLAKE2b-256 checksum
How to use checksums
bd1d441181373500d23ec65a4592613cc5cf1a084af35c04470de8258f3ae3f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 21, 2026.

Transparency log

Security for voicelayer-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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for voicelayer_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 Oct 21, 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.

Release history Release notifications | RSS feed

This release

0.1.0 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