Skip to content

Commit fbf3a4b

Browse files
committed
Add AgentPhone integration docs
1 parent 5525bc4 commit fbf3a4b

File tree

4 files changed

+172
-0
lines changed

4 files changed

+172
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: "AgentPhone integrations"
3+
description: "Integrate with AgentPhone using LangChain Python."
4+
---
5+
6+
[AgentPhone](https://agentphone.to) is a telephony platform for AI agents, providing messaging, voice calls, phone number management, and contact management through a simple API.
7+
8+
## Installation and setup
9+
10+
<CodeGroup>
11+
```bash pip
12+
pip install langchain-agentphone
13+
```
14+
15+
```bash uv
16+
uv add langchain-agentphone
17+
```
18+
</CodeGroup>
19+
20+
Get your API key from [agentphone.to](https://agentphone.to) and set it as an environment variable:
21+
22+
```bash
23+
export AGENTPHONE_API_KEY="your-api-key"
24+
```
25+
26+
## Tools
27+
28+
See the [AgentPhone Toolkit](/oss/integrations/tools/agentphone) guide for details on available tools including messaging, voice calls, phone number management, and more.

src/oss/python/integrations/providers/all_providers.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ Browse the complete collection of integrations available for Python. LangChain P
5757
Open event-based protocol for connecting LangGraph agents to any frontend.
5858
</Card>
5959

60+
<Card
61+
title="AgentPhone"
62+
href="/oss/integrations/providers/agentphone"
63+
icon="link"
64+
>
65+
Telephony platform for AI agents with messaging, voice calls, and phone number management.
66+
</Card>
67+
6068
<Card
6169
title="AgentQL"
6270
href="/oss/integrations/providers/agentql"
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: "AgentPhone Toolkit"
3+
description: "Integrate with the AgentPhone toolkit using LangChain Python."
4+
---
5+
6+
[AgentPhone](https://agentphone.to) is a telephony platform for AI agents. The `langchain-agentphone` package provides LangChain tools for sending messages, making AI-powered phone calls, managing phone numbers, and more.
7+
8+
## Overview
9+
10+
### Integration details
11+
12+
| Class | Package | Serializable | [JS support](https://js.langchain.com) | Version |
13+
|:------|:--------| :---: | :---: | :---: |
14+
| `AgentPhoneToolkit` | [`langchain-agentphone`](https://pypi.org/project/langchain-agentphone/) ||| ![PyPI - Version](https://img.shields.io/pypi/v/langchain-agentphone?style=flat-square&label=%20) |
15+
16+
### Available tools
17+
18+
| Tool | Description |
19+
|:-----|:------------|
20+
| `AgentPhoneSendSMS` | Send a text message |
21+
| `AgentPhoneMakeCall` | Make an AI-powered outbound phone call |
22+
| `AgentPhoneGetTranscript` | Get the transcript of a phone call |
23+
| `AgentPhoneListCalls` | List phone calls with optional filters |
24+
| `AgentPhoneListConversations` | List conversations |
25+
| `AgentPhoneGetConversation` | Get a conversation with its messages |
26+
| `AgentPhoneBuyNumber` | Buy a new phone number |
27+
| `AgentPhoneListNumbers` | List phone numbers on the account |
28+
| `AgentPhoneCreateAgent` | Create a new AI phone agent |
29+
| `AgentPhoneListAgents` | List AI phone agents |
30+
| `AgentPhoneCreateContact` | Create a new contact |
31+
| `AgentPhoneListContacts` | List contacts |
32+
33+
## Setup
34+
35+
Install the package:
36+
37+
```bash
38+
pip install -qU langchain-agentphone
39+
```
40+
41+
### Credentials
42+
43+
You need an AgentPhone API key. Sign up at [agentphone.to](https://agentphone.to) to get one.
44+
45+
```python
46+
import getpass
47+
import os
48+
49+
if not os.environ.get("AGENTPHONE_API_KEY"):
50+
os.environ["AGENTPHONE_API_KEY"] = getpass.getpass("AgentPhone API key:\n")
51+
```
52+
53+
## Instantiation
54+
55+
Use the toolkit to get all tools at once, or select specific ones:
56+
57+
```python
58+
from langchain_agentphone import AgentPhoneToolkit
59+
60+
# All tools
61+
toolkit = AgentPhoneToolkit()
62+
tools = toolkit.get_tools()
63+
64+
# Or select specific tools
65+
toolkit = AgentPhoneToolkit(selected_tools=["send_sms", "list_numbers", "make_call"])
66+
tools = toolkit.get_tools()
67+
```
68+
69+
You can also instantiate individual tools directly:
70+
71+
```python
72+
from langchain_agentphone import AgentPhoneSendSMS, AgentPhoneListNumbers
73+
74+
send_sms = AgentPhoneSendSMS()
75+
list_numbers = AgentPhoneListNumbers()
76+
```
77+
78+
## Invocation
79+
80+
### Invoke directly with args
81+
82+
```python
83+
from langchain_agentphone import AgentPhoneSendSMS
84+
85+
tool = AgentPhoneSendSMS()
86+
result = tool.invoke({
87+
"number_id": "num_abc123",
88+
"to_number": "+14155551234",
89+
"body": "Hello from LangChain!"
90+
})
91+
print(result)
92+
```
93+
94+
### Invoke with ToolCall
95+
96+
```python
97+
model_generated_tool_call = {
98+
"args": {
99+
"number_id": "num_abc123",
100+
"to_number": "+14155551234",
101+
"body": "Meeting at 3pm confirmed."
102+
},
103+
"id": "1",
104+
"name": "agentphone_send_sms",
105+
"type": "tool_call",
106+
}
107+
tool_msg = tool.invoke(model_generated_tool_call)
108+
print(tool_msg.content)
109+
```
110+
111+
## Use within an agent
112+
113+
```python
114+
from langchain_agentphone import AgentPhoneToolkit
115+
from langchain.chat_models import init_chat_model
116+
from langgraph.prebuilt import create_react_agent
117+
118+
model = init_chat_model(model="claude-sonnet-4-6", model_provider="anthropic")
119+
120+
toolkit = AgentPhoneToolkit(
121+
selected_tools=["send_sms", "list_numbers", "list_contacts"]
122+
)
123+
agent = create_react_agent(model, toolkit.get_tools())
124+
125+
response = agent.invoke({
126+
"messages": [("user", "List my phone numbers, then send a message to +14155551234 saying 'Hello!'")]
127+
})
128+
```
129+
130+
---
131+
132+
## API reference
133+
134+
For detailed documentation of the AgentPhone API, visit [docs.agentphone.to](https://docs.agentphone.to).

src/oss/python/integrations/tools/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The following table shows tools that can be used to automate tasks in productivi
5757
| [Jira Toolkit](/oss/integrations/tools/jira) | Free, with [rate limits](https://developer.atlassian.com/cloud/jira/platform/rate-limiting/) |
5858
| [Office365 Toolkit](/oss/integrations/tools/office365) | Free with Office365, includes [rate limits](https://learn.microsoft.com/en-us/graph/throttling-limits) |
5959
| [Slack Toolkit](/oss/integrations/tools/slack) | Free |
60+
| [AgentPhone Toolkit](/oss/integrations/tools/agentphone) | Free tier available, with [pay-as-you-go pricing](https://agentphone.to) after |
6061
| [Twilio Tool](/oss/integrations/tools/twilio) | Free trial, with [pay-as-you-go pricing](https://www.twilio.com/en-us/pricing) after |
6162

6263
## Web browsing
@@ -110,6 +111,7 @@ The following platforms provide access to multiple tools and services through a
110111

111112
<Columns cols={3}>
112113
<Card title="ADS4GPTs" icon="link" href="/oss/integrations/tools/ads4gpts" arrow="true" cta="View guide" />
114+
<Card title="AgentPhone Toolkit" icon="link" href="/oss/integrations/tools/agentphone" arrow="true" cta="View guide" />
113115
<Card title="AgentQL" icon="link" href="/oss/integrations/tools/agentql" arrow="true" cta="View guide" />
114116
<Card title="AINetwork Toolkit" icon="link" href="/oss/integrations/tools/ainetwork" arrow="true" cta="View guide" />
115117
<Card title="Alpha Vantage" icon="link" href="/oss/integrations/tools/alpha_vantage" arrow="true" cta="View guide" />

0 commit comments

Comments
 (0)