twilio-agent-connect 2.3.0 → 2.5.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 +23 -9
- package/dist/index.d.ts +2632 -735
- package/dist/index.js +3926 -912
- package/dist/index.js.map +1 -1
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ Seamlessly integrate with Twilio Conversation Memory and Conversation Orchestrat
|
|
|
38
38
|
## Key Features
|
|
39
39
|
|
|
40
40
|
- **Multi-Channel Support**: Built-in handling for Voice (ConversationRelay), SMS, RCS, WhatsApp, and Chat
|
|
41
|
+
- **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
42
|
- **Outbound Conversations**: Agent-initiated conversations across all supported channels
|
|
42
43
|
- **ConversationRelay-Only Mode**: Get started quickly with TAC's voice plumbing (TwiML, WebSocket, callbacks) before adding Conversation Orchestrator or Conversation Memory
|
|
43
44
|
- **Memory Management**: Automatic integration with Twilio Conversation Memory for persistent user context
|
|
@@ -56,12 +57,13 @@ npm install twilio-agent-connect
|
|
|
56
57
|
|
|
57
58
|
**Option 1: Use the Setup Wizard**
|
|
58
59
|
|
|
59
|
-
Use the [Twilio Setup Wizard](
|
|
60
|
+
Use the [Twilio Setup Wizard](getting_started/twilio-setup/) to automatically create a Memory Store and Conversation Configuration and generate your `.env` file:
|
|
60
61
|
|
|
61
62
|
```bash
|
|
62
|
-
git clone https://github.com/twilio/twilio-agent-connect-
|
|
63
|
-
cd twilio-agent-connect-
|
|
64
|
-
|
|
63
|
+
git clone https://github.com/twilio/twilio-agent-connect-typescript.git
|
|
64
|
+
cd twilio-agent-connect-typescript
|
|
65
|
+
npm install
|
|
66
|
+
npm run setup # Open http://localhost:8080
|
|
65
67
|
```
|
|
66
68
|
|
|
67
69
|
**Option 2: Manual Setup**
|
|
@@ -107,10 +109,6 @@ const tac = await TAC.create({ config: TACConfig.fromEnv() });
|
|
|
107
109
|
const voiceChannel = new VoiceChannel(tac);
|
|
108
110
|
const smsChannel = new SMSChannel(tac);
|
|
109
111
|
|
|
110
|
-
// Register channels
|
|
111
|
-
tac.registerChannel(voiceChannel);
|
|
112
|
-
tac.registerChannel(smsChannel);
|
|
113
|
-
|
|
114
112
|
// Store conversation history
|
|
115
113
|
const conversationHistory: Record<string, OpenAI.Chat.ChatCompletionMessageParam[]> = {};
|
|
116
114
|
|
|
@@ -148,7 +146,7 @@ tac.onMessageReady(async ({ conversationId, message, memory, session }) => {
|
|
|
148
146
|
return llmResponse;
|
|
149
147
|
});
|
|
150
148
|
|
|
151
|
-
const server = new TACServer(tac);
|
|
149
|
+
const server = new TACServer(tac, { voiceChannel, messagingChannels: [smsChannel] });
|
|
152
150
|
await server.start();
|
|
153
151
|
```
|
|
154
152
|
|
|
@@ -176,17 +174,33 @@ TAC simplifies building AI agents by handling the integration between Twilio's c
|
|
|
176
174
|
|
|
177
175
|
For detailed architecture and advanced usage, see [CLAUDE.md](https://github.com/twilio/twilio-agent-connect-typescript/blob/main/CLAUDE.md).
|
|
178
176
|
|
|
177
|
+
## Telemetry
|
|
178
|
+
|
|
179
|
+
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.
|
|
180
|
+
|
|
181
|
+
Message content, transcripts, phone numbers, and other end-user identifiers are never collected.
|
|
182
|
+
|
|
183
|
+
Telemetry is on by default. To disable it, set the following environment variable:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
TAC_ANALYTICS_DISABLED=true
|
|
187
|
+
```
|
|
188
|
+
|
|
179
189
|
## Learn More
|
|
180
190
|
|
|
181
191
|
**Examples & Guides:**
|
|
182
192
|
- **[API Reference](https://twilio.github.io/twilio-agent-connect-typescript/)** - Full API documentation generated from the source
|
|
183
193
|
- **[Getting Started Guide](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/)** - Examples and comprehensive documentation
|
|
194
|
+
- **[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
|
|
184
195
|
- **[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
|
|
185
196
|
- **[WhatsApp Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/whatsapp/)** - WhatsApp channel with memory integration
|
|
186
197
|
- **[Chat Example](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/chat/)** - Web chat integration example
|
|
187
198
|
- **[ConversationRelay-Only Mode](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/relay-only/)** - Get started with voice using just ConversationRelay
|
|
199
|
+
- **[OpenAI Realtime over Media Streams](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/openai-realtime/)** - Speech-to-speech voice calls, bridging Twilio Media Streams to the OpenAI Realtime API
|
|
200
|
+
- **[GPT-Live over Media Streams](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/gpt-live/)** - Speech-to-speech voice calls, bridging Twilio Media Streams to the OpenAI GPT-Live API
|
|
188
201
|
- **[Outbound Conversations](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/outbound/)** - Agent-initiated conversations example
|
|
189
202
|
- **[Voice Call Events](https://github.com/twilio/twilio-agent-connect-typescript/tree/main/getting_started/examples/voice-call-events/)** - Answering machine detection, recording, and call disposition on outbound calls
|
|
203
|
+
- **[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
|
|
190
204
|
- More examples coming soon
|
|
191
205
|
|
|
192
206
|
**AWS and Microsoft connectors:**
|