Metadata-Version: 2.4
Name: langchain-agentphone
Version: 0.1.0
Summary: LangChain integration for AgentPhone — telephony tools for AI agents
Project-URL: Homepage, https://agentphone.to
Project-URL: Documentation, https://docs.agentphone.to
Project-URL: Repository, https://github.com/AgentPhone-AI/langchain-agentphone
Project-URL: PyPI, https://pypi.org/project/langchain-agentphone/
Author-email: AgentPhone <support@agentphone.to>
License: MIT
License-File: LICENSE
Keywords: agentphone,ai-agents,langchain,sms,telephony,voice
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Communications :: Telephony
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: <4.0,>=3.9
Requires-Dist: agentphone<1.0.0,>=0.5.0
Requires-Dist: langchain-core<1.0.0,>=0.3.0
Description-Content-Type: text/markdown

# langchain-agentphone

[![PyPI version](https://img.shields.io/pypi/v/langchain-agentphone)](https://pypi.org/project/langchain-agentphone/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

LangChain integration for [AgentPhone](https://agentphone.to) — telephony tools that let LLM agents send SMS messages, make phone calls, and manage phone numbers.

## Installation

```bash
pip install langchain-agentphone
```

## Setup

Get your API key from [agentphone.to](https://agentphone.to) and set it as an environment variable:

```bash
export AGENTPHONE_API_KEY="your-api-key"
```

## Quick Start

### Use all tools

```python
from langchain_agentphone import AgentPhoneToolkit

toolkit = AgentPhoneToolkit()
tools = toolkit.get_tools()
```

### Use specific tools

```python
from langchain_agentphone import AgentPhoneToolkit

toolkit = AgentPhoneToolkit(selected_tools=["send_sms", "list_numbers"])
tools = toolkit.get_tools()
```

### Use individual tools

```python
from langchain_agentphone import AgentPhoneSendSMS

tool = AgentPhoneSendSMS()
result = tool.invoke({
    "number_id": "num_abc123",
    "to_number": "+14155551234",
    "body": "Hello from LangChain!"
})
```

### With a LangChain agent

```python
from langchain_agentphone import AgentPhoneToolkit
from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent

llm = ChatAnthropic(model="claude-sonnet-4-20250514")
toolkit = AgentPhoneToolkit()
agent = create_react_agent(llm, toolkit.get_tools())

response = agent.invoke({
    "messages": [("user", "Send an SMS from number num_abc123 to +14155551234 saying hello")]
})
```

## Available Tools

| Tool | Name | Description |
|------|------|-------------|
| `AgentPhoneSendSMS` | `agentphone_send_sms` | Send an SMS message |
| `AgentPhoneMakeCall` | `agentphone_make_call` | Make an AI-powered outbound call |
| `AgentPhoneGetTranscript` | `agentphone_get_transcript` | Get a call transcript |
| `AgentPhoneListCalls` | `agentphone_list_calls` | List phone calls |
| `AgentPhoneListConversations` | `agentphone_list_conversations` | List SMS conversations |
| `AgentPhoneGetConversation` | `agentphone_get_conversation` | Get conversation with messages |
| `AgentPhoneBuyNumber` | `agentphone_buy_number` | Buy a phone number |
| `AgentPhoneListNumbers` | `agentphone_list_numbers` | List phone numbers |
| `AgentPhoneCreateAgent` | `agentphone_create_agent` | Create an AI phone agent |
| `AgentPhoneListAgents` | `agentphone_list_agents` | List AI phone agents |
| `AgentPhoneCreateContact` | `agentphone_create_contact` | Create a contact |
| `AgentPhoneListContacts` | `agentphone_list_contacts` | List contacts |

## API Reference

See the [AgentPhone documentation](https://docs.agentphone.to) for full API details.
