ttp-agent-sdk 2.3.18 → 2.3.19
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 +35 -0
- package/dist/agent-widget.js.map +1 -1
- package/dist/index.html +1033 -36
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# TTP Agent SDK
|
|
2
2
|
|
|
3
|
+
This repository contains SDKs for integrating with the TTP Agent API:
|
|
4
|
+
|
|
5
|
+
- **Frontend SDK (JavaScript)** - Browser-based SDK for web applications
|
|
6
|
+
- **Backend SDK (Java)** - Server-side SDK for phone systems and backend processing
|
|
7
|
+
|
|
8
|
+
## Frontend SDK (JavaScript)
|
|
9
|
+
|
|
3
10
|
A comprehensive JavaScript SDK for voice interaction with AI agents. Provides real-time audio recording, WebSocket communication, and audio playback with queue management.
|
|
4
11
|
|
|
5
12
|
## Features
|
|
@@ -299,6 +306,34 @@ npm test
|
|
|
299
306
|
|
|
300
307
|
MIT
|
|
301
308
|
|
|
309
|
+
## Backend SDK (Java)
|
|
310
|
+
|
|
311
|
+
For server-side applications, phone system integration, or backend processing, see the [Java SDK documentation](java-sdk/README.md).
|
|
312
|
+
|
|
313
|
+
**Key Features:**
|
|
314
|
+
- ✅ Format negotiation (Protocol v2)
|
|
315
|
+
- ✅ Raw audio pass-through (PCMU/PCMA for phone systems)
|
|
316
|
+
- ✅ No audio decoding (perfect for forwarding to phone systems)
|
|
317
|
+
- ✅ Event-driven API
|
|
318
|
+
|
|
319
|
+
**Quick Start:**
|
|
320
|
+
|
|
321
|
+
```java
|
|
322
|
+
VoiceSDKConfig config = new VoiceSDKConfig();
|
|
323
|
+
config.setWebsocketUrl("wss://speech.talktopc.com/ws/conv?agentId=xxx&appId=yyy");
|
|
324
|
+
config.setOutputEncoding("pcmu"); // For phone systems
|
|
325
|
+
config.setOutputSampleRate(8000);
|
|
326
|
+
|
|
327
|
+
VoiceSDK sdk = new VoiceSDK(config);
|
|
328
|
+
sdk.onAudioData(audioData -> {
|
|
329
|
+
// Forward raw PCMU to phone system
|
|
330
|
+
phoneSystem.sendAudio(audioData);
|
|
331
|
+
});
|
|
332
|
+
sdk.connect();
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
See [java-sdk/README.md](java-sdk/README.md) for full documentation.
|
|
336
|
+
|
|
302
337
|
## Support
|
|
303
338
|
|
|
304
339
|
For support and questions, please open an issue on GitHub or contact our support team.
|