Skip to main content

Official Dial LangChain tools — phone numbers, SMS, WhatsApp, and voice calls for AI agents

Project description

dial-langchain

Official LangChain tools for Dial — phone numbers, SMS, WhatsApp, and AI voice calls for AI agents.

Install

pip install dial-langchain
# or
uv add dial-langchain

This pulls in dial-sdk and langchain-core automatically. Requires Python 3.11+.

Quickstart

Build one DialClient, hand it to DialToolkit, and call get_tools() to give an agent the full set — no per-tool imports. Every tool shares that one client (a single connection pool):

from dial_sdk import DialClient, DialConfig
from dial_langchain import DialToolkit
from langchain.chat_models import init_chat_model
from langgraph.prebuilt import create_react_agent

model = init_chat_model("claude-sonnet-4-6", model_provider="anthropic")

dial = DialClient(DialConfig(api_key="sk_live_..."))
toolkit = DialToolkit(client=dial)
agent = create_react_agent(model, toolkit.get_tools())

DialToolkit is a standard LangChain BaseToolkit, so get_tools() works anywhere a list of tools is expected. DialConfig also takes an optional base_url (defaults to https://api.getdial.ai; override it for local or self-hosted setups).

Pick individual tools

When you only want a subset, import the tools directly and pass them the same client. Each Dial capability is a LangChain BaseTool:

from dial_sdk import DialClient, DialConfig
from dial_langchain import (
    ListNumbersTool,
    SendMessageTool,
    MakeCallTool,
    ListCallsTool,
    GetCallTool,
    WaitForMessageTool,
)

dial = DialClient(DialConfig(api_key="sk_live_..."))
tools = [
    ListNumbersTool(client=dial),
    SendMessageTool(client=dial),
    MakeCallTool(client=dial),
]

# Drop into any LangChain agent:
from langchain.agents import create_react_agent
agent = create_react_agent(model, tools, prompt)

The tools are async — LangChain calls them via ainvoke.

Available tools

Tool Tool name (for the LLM)
ListNumbersTool list_numbers
PurchaseNumberTool purchase_number
SetNumberPropertiesTool set_number_properties
ListMessagesTool list_messages
SendMessageTool send_message
ReplyToMessageTool reply_to_message
ListCallsTool list_calls
MakeCallTool make_call
GetCallTool get_call
WaitForMessageTool wait_for_message

Each tool wraps the corresponding dial-sdk call under the hood. DialToolkit.get_tools() returns all of them.

Related

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dial_langchain-0.16.0.tar.gz (134.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dial_langchain-0.16.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file dial_langchain-0.16.0.tar.gz.

File metadata

  • Download URL: dial_langchain-0.16.0.tar.gz
  • Upload date:
  • Size: 134.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dial_langchain-0.16.0.tar.gz
Algorithm Hash digest
SHA256 4260e9c91f74740684f035ae50c95b93e5a482c6b61479cea8e2295d1905cd93
MD5 b0eeedc96d6d1efe89295e1bd6913888
BLAKE2b-256 b52f3bcb1fda3eae8239b13d1d189805695e2e533a3869567cddafcabc2807d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for dial_langchain-0.16.0.tar.gz:

Publisher: publish-sdk-langchain.yml on GENWAY-AI/dial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dial_langchain-0.16.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dial_langchain-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6f676a2423f60556dadb8d54fe68ce3d301e786965c1925c68850b2a56f1be9
MD5 78b97325074848312d05d6bb900dfc50
BLAKE2b-256 8ccc6346fb278bd08bee24ddfe03b6ceb7119a27ded0d5cc7e17149b7b61a470

See more details on using hashes here.

Provenance

The following attestation bundles were made for dial_langchain-0.16.0-py3-none-any.whl:

Publisher: publish-sdk-langchain.yml on GENWAY-AI/dial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page