Metadata-Version: 2.4
Name: dial-langchain
Version: 0.5.0
Summary: Official Dial LangChain tools — phone numbers, SMS, WhatsApp, and voice calls for AI agents
Requires-Python: >=3.11
Requires-Dist: dial-sdk
Requires-Dist: langchain-core>=0.2
Description-Content-Type: text/markdown

# dial-langchain

Official [LangChain](https://www.langchain.com/) tools for [Dial](https://getdial.ai) — phone numbers, SMS, WhatsApp, and voice calls for AI agents.

## Install

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

This pulls in [`dial-sdk`](https://pypi.org/project/dial-sdk/) and `langchain-core` automatically. Requires Python 3.11+.

## Quickstart

Each Dial capability is a LangChain `BaseTool`. Construct it with your API key (and optional `base_url`) and hand it to an agent:

```python
from dial_langchain import (
    ListNumbersTool,
    SendMessageTool,
    MakeCallTool,
    ListCallsTool,
    GetCallTool,
    WaitForMessageTool,
)

tools = [
    ListNumbersTool(api_key="sk_live_..."),
    SendMessageTool(api_key="sk_live_..."),
    MakeCallTool(api_key="sk_live_..."),
]

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

`base_url` defaults to `https://getdial.ai`; override it for local or self-hosted setups.

## Available tools

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

Each tool wraps the corresponding [`dial-sdk`](https://pypi.org/project/dial-sdk/) call under the hood.

## Related

- [`dial-sdk`](https://pypi.org/project/dial-sdk/) — the underlying async Python SDK.
- [Documentation](https://docs.getdial.ai)
