twilio-agent-connect 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -12
- package/dist/index.d.ts +991 -200
- package/dist/index.js +2227 -1023
- package/dist/index.js.map +1 -1
- package/package.json +9 -5
package/README.md
CHANGED
|
@@ -29,20 +29,23 @@
|
|
|
29
29
|
Seamlessly integrate with Twilio Conversation Memory and Conversation Orchestrator to build LLM-powered agents with persistent memory and conversation context.
|
|
30
30
|
|
|
31
31
|
> [!TIP]
|
|
32
|
-
> **Building AI agents on AWS or
|
|
32
|
+
> **Building AI agents on AWS, Microsoft, or Google?** Connect them to Twilio's voice, messaging, and conversation context with these dedicated packages:
|
|
33
33
|
> - **[TAC for AWS](https://github.com/twilio/twilio-agent-connect-aws)** — Strands, Bedrock Agents, Bedrock AgentCore
|
|
34
34
|
> - **[TAC for Microsoft](https://github.com/twilio/twilio-agent-connect-microsoft)** — Microsoft Agent Framework, Azure AI Foundry (incl. Voice Live), Azure OpenAI
|
|
35
|
+
> - **[TAC for Google](https://github.com/twilio/twilio-agent-connect-google)** — ADK and Agent Studio on Agent Engine, CX Agent Studio, Conversational Agents (Dialogflow CX)
|
|
35
36
|
|
|
36
37
|
---
|
|
37
38
|
|
|
38
39
|
## Key Features
|
|
39
40
|
|
|
40
41
|
- **Multi-Channel Support**: Built-in handling for Voice (ConversationRelay), SMS, RCS, WhatsApp, and Chat
|
|
42
|
+
- **Multi-Sender Support**: Configure multiple phone numbers, RCS Sender IDs, or WhatsApp numbers per channel by setting the comma-separated plural env var (`TWILIO_PHONE_NUMBERS`, `TWILIO_RCS_SENDER_IDS`, `TWILIO_WHATSAPP_NUMBERS`) instead of the singular one; the first entry is the default sender for outbound
|
|
41
43
|
- **Outbound Conversations**: Agent-initiated conversations across all supported channels
|
|
42
44
|
- **ConversationRelay-Only Mode**: Get started quickly with TAC's voice plumbing (TwiML, WebSocket, callbacks) before adding Conversation Orchestrator or Conversation Memory
|
|
43
45
|
- **Memory Management**: Automatic integration with Twilio Conversation Memory for persistent user context
|
|
44
46
|
- **Conversation Lifecycle**: Automatic tracking of conversation sessions and state
|
|
45
47
|
- **Human Handoff**: Built-in tool to route conversations to human agents via Twilio Studio Flows (including Flex)
|
|
48
|
+
- **Horizontal Scaling**: Run N replicas behind a load balancer with no shared datastore; for voice, set `TWILIO_INSTANCE_PUBLIC_DOMAIN` to each replica's own public hostname
|
|
46
49
|
|
|
47
50
|
## Get Started
|
|
48
51
|
|
|
@@ -56,12 +59,13 @@ npm install twilio-agent-connect
|
|
|
56
59
|
|
|
57
60
|
**Option 1: Use the Setup Wizard**
|
|
58
61
|
|
|
59
|
-
Use the [Twilio Setup Wizard](
|
|
62
|
+
Use the [Twilio Setup Wizard](getting_started/twilio-setup/) to automatically create a Memory Store and Conversation Configuration and generate your `.env` file:
|
|
60
63
|
|
|
61
64
|
```bash
|
|
62
|
-
git clone https://github.com/twilio/twilio-agent-connect-
|
|
63
|
-
cd twilio-agent-connect-
|
|
64
|
-
|
|
65
|
+
git clone https://github.com/twilio/twilio-agent-connect-typescript.git
|
|
66
|
+
cd twilio-agent-connect-typescript
|
|
67
|
+
npm install
|
|
68
|
+
npm run setup # Open http://localhost:8080
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
**Option 2: Manual Setup**
|
|
@@ -107,10 +111,6 @@ const tac = await TAC.create({ config: TACConfig.fromEnv() });
|
|
|
107
111
|
const voiceChannel = new VoiceChannel(tac);
|
|
108
112
|
const smsChannel = new SMSChannel(tac);
|
|
109
113
|
|
|
110
|
-
// Register channels
|
|
111
|
-
tac.registerChannel(voiceChannel);
|
|
112
|
-
tac.registerChannel(smsChannel);
|
|
113
|
-
|
|
114
114
|
// Store conversation history
|
|
115
115
|
const conversationHistory: Record<string, OpenAI.Chat.ChatCompletionMessageParam[]> = {};
|
|
116
116
|
|
|
@@ -148,7 +148,7 @@ tac.onMessageReady(async ({ conversationId, message, memory, session }) => {
|
|
|
148
148
|
return llmResponse;
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
const server = new TACServer(tac);
|
|
151
|
+
const server = new TACServer(tac, { voiceChannel, messagingChannels: [smsChannel] });
|
|
152
152
|
await server.start();
|
|
153
153
|
```
|
|
154
154
|
|
|
@@ -178,7 +178,7 @@ For detailed architecture and advanced usage, see [CLAUDE.md](https://github.com
|
|
|
178
178
|
|
|
179
179
|
## Telemetry
|
|
180
180
|
|
|
181
|
-
The SDK reports usage events to help improve the product — conversation started and ended, messages received, responses sent, and voice connection and interrupt events. Each event includes your Twilio account SID, the channel, a conversation ID, the SDK name and version, and timing such as conversation duration.
|
|
181
|
+
The SDK reports usage events to help improve the product — conversation started and ended, messages received, responses sent, and voice connection and interrupt events. Each event includes your Twilio account SID, the channel (when TAC already knows it — conversation ended events from Conversation Orchestrator don't carry one), a conversation ID, the SDK name and version, and timing such as conversation duration.
|
|
182
182
|
|
|
183
183
|
Message content, transcripts, phone numbers, and other end-user identifiers are never collected.
|
|
184
184
|
|
|
@@ -193,6 +193,7 @@ TAC_ANALYTICS_DISABLED=true
|
|
|
193
193
|
**Examples & Guides:**
|
|
194
194
|
- **[API Reference](https://twilio.github.io/twilio-agent-connect-typescript/)** - Full API documentation generated from the source
|
|
195
195
|
- **[Getting Started Guide](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/)** - Examples and comprehensive documentation
|
|
196
|
+
- **[Twilio Setup Wizard](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/twilio-setup/)** - Create your Memory Store and Conversation Configuration from a local web UI
|
|
196
197
|
- **[OpenAI SDK Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/openai/)** - Complete multi-channel example with Voice, SMS, and Chat
|
|
197
198
|
- **[WhatsApp Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/whatsapp/)** - WhatsApp channel with memory integration
|
|
198
199
|
- **[Chat Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/chat/)** - Web chat integration example
|
|
@@ -204,9 +205,10 @@ TAC_ANALYTICS_DISABLED=true
|
|
|
204
205
|
- **[Voice DTMF](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/voice-dtmf/)** - Keypad input over ConversationRelay — collect an account number digit by digit and hand it to the agent as context
|
|
205
206
|
- More examples coming soon
|
|
206
207
|
|
|
207
|
-
**AWS and
|
|
208
|
+
**AWS, Microsoft, and Google connectors:**
|
|
208
209
|
- **[TAC for AWS](https://github.com/twilio/twilio-agent-connect-aws)** — `StrandsConnector`, `BedrockConnector`, `BedrockAgentCoreConnector` for AWS Strands, Bedrock Agents, and Bedrock AgentCore
|
|
209
210
|
- **[TAC for Microsoft](https://github.com/twilio/twilio-agent-connect-microsoft)** — `AgentFrameworkConnector` and `VoiceLiveConnector` for Microsoft Agent Framework, Azure AI Foundry (including Voice Live), and Azure OpenAI
|
|
211
|
+
- **[TAC for Google](https://github.com/twilio/twilio-agent-connect-google)** — `ADKAgentEngineConnector`, `StudioAgentEngineConnector`, `CXAgentStudioConnector`, `ConversationalAgentsConnector` for Google ADK, Agent Studio, CX Agent Studio, and Conversational Agents (Dialogflow CX)
|
|
210
212
|
|
|
211
213
|
**Documentation:**
|
|
212
214
|
- **[CLAUDE.md](https://github.com/twilio/twilio-agent-connect-typescript/blob/main/CLAUDE.md)** - Architecture, development guide, and API reference
|