dial_langchain¶
Submodules¶
Classes¶
All Dial tools in one bundle — phone numbers, SMS/WhatsApp, and voice calls. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
|
Base for Dial LangChain tools. |
Package Contents¶
- class dial_langchain.DialToolkit¶
Bases:
langchain_core.tools.BaseToolkitAll Dial tools in one bundle — phone numbers, SMS/WhatsApp, and voice calls.
Build one
DialClientand construct the toolkit with it, then callget_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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas a field.- description: str = 'List all available Dial phone numbers on the account.'¶
- name: str = 'list_numbers'¶
- class dial_langchain.MakeCallTool¶
Bases:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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:
_DialToolBase 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_arunin their event loop, so the shared client is safe.arbitrary_types_allowedlets the Pydantic-basedBaseToolcarry the non-PydanticDialClientas 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'¶