dial_langchain

Submodules

Classes

DialToolkit

All Dial tools in one bundle — phone numbers, SMS/WhatsApp, and voice calls.

GetBillingTool

Base for Dial LangChain tools.

GetCallTool

Base for Dial LangChain tools.

ListCallsTool

Base for Dial LangChain tools.

ListMessagesTool

Base for Dial LangChain tools.

ListNumbersTool

Base for Dial LangChain tools.

MakeCallTool

Base for Dial LangChain tools.

PurchaseNumberTool

Base for Dial LangChain tools.

ReplyToMessageTool

Base for Dial LangChain tools.

SendMessageTool

Base for Dial LangChain tools.

SetNumberPropertiesTool

Base for Dial LangChain tools.

StartTypingTool

Base for Dial LangChain tools.

StopTypingTool

Base for Dial LangChain tools.

WaitForMessageTool

Base for Dial LangChain tools.

Package Contents

class dial_langchain.DialToolkit

Bases: langchain_core.tools.BaseToolkit

All Dial tools in one bundle — phone numbers, SMS/WhatsApp, and voice calls.

Build one DialClient and construct the toolkit with it, then call get_tools() to hand the full set to an agent. Every tool shares that one client — a single connection pool for the whole agent:

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")
client = DialClient(DialConfig(api_key="sk_live_..."))
toolkit = DialToolkit(client=client)
agent = create_react_agent(model, toolkit.get_tools())
get_tools() list[langchain_core.tools.BaseTool]

Return every Dial tool, each sharing this toolkit’s client.

client: dial_sdk.DialClient
model_config
class dial_langchain.GetBillingTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

description: str = "Get the account's billing status: credit balance, subscription (if any), each number's billing...
name: str = 'get_billing'
class dial_langchain.GetCallTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'Fetch a single call by its id, including its current status.'
name: str = 'get_call'
class dial_langchain.ListCallsTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'List recent inbound and outbound calls on the account.'
name: str = 'list_calls'
class dial_langchain.ListMessagesTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'List recent inbound and outbound messages on the account.'
name: str = 'list_messages'
class dial_langchain.ListNumbersTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

description: str = 'List all available Dial phone numbers on the account.'
name: str = 'list_numbers'
class dial_langchain.MakeCallTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'Initiate an AI voice call to a phone number.'
name: str = 'make_call'
class dial_langchain.PurchaseNumberTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'Provision (buy) a new Dial phone number. Billable.'
name: str = 'purchase_number'
class dial_langchain.ReplyToMessageTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'Reply in-thread or react to an existing message. The reply goes out from the Dial number the...
name: str = 'reply_to_message'
class dial_langchain.SendMessageTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'Send a message to a phone number, optionally with media attachments (MMS). On an iMessage...
name: str = 'send_message'
class dial_langchain.SetNumberPropertiesTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = "Update a Dial phone number's properties: its inbound instruction (the system prompt its AI...
name: str = 'set_number_properties'
class dial_langchain.StartTypingTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = "Show a typing indicator to the recipient, as if composing a message from your number. iMessage...
name: str = 'start_typing'
class dial_langchain.StopTypingTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = "Clear a typing indicator previously shown with start_typing. Delivering a message or reaction...
name: str = 'stop_typing'
class dial_langchain.WaitForMessageTool

Bases: _DialTool

Base for Dial LangChain tools.

Holds a shared DialClient (passed in, not constructed per call) so every tool reuses one connection pool. These tools are async-only: LangChain/LangGraph agents invoke them via _arun in their event loop, so the shared client is safe. arbitrary_types_allowed lets the Pydantic-based BaseTool carry the non-Pydantic DialClient as a field.

args_schema: type[pydantic.BaseModel]
description: str = 'Wait for the next inbound SMS or WhatsApp message and return it. Blocks until a message arrives...
name: str = 'wait_for_message'