ttp-agent-sdk 2.0.0 → 2.0.1
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/GETTING_STARTED.md +6 -6
- package/README.md +6 -6
- package/dist/agent-widget.js +1 -1
- package/dist/agent-widget.js.map +1 -1
- package/dist/examples/react-example.html +3 -3
- package/dist/examples/react-example.jsx +2 -2
- package/dist/examples/test.html +2 -2
- package/dist/examples/vanilla-example.html +3 -3
- package/dist/index.html +2 -2
- package/examples/react-example.html +3 -3
- package/examples/react-example.jsx +2 -2
- package/examples/test.html +2 -2
- package/examples/vanilla-example.html +3 -3
- package/package.json +1 -1
- package/src/core/VoiceSDK.js +1 -1
- package/src/vanilla/VoiceButton.js +1 -1
|
@@ -98,7 +98,7 @@ function VoiceChat() {
|
|
|
98
98
|
|
|
99
99
|
useEffect(() => {
|
|
100
100
|
const voiceSDK = new VoiceSDK({
|
|
101
|
-
|
|
101
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
102
102
|
agentId: 'your_agent_id',
|
|
103
103
|
appId: 'your_app_id'
|
|
104
104
|
});
|
|
@@ -158,7 +158,7 @@ import { VoiceButton } from 'ttp-agent-sdk';
|
|
|
158
158
|
function App() {
|
|
159
159
|
return (
|
|
160
160
|
<VoiceButton
|
|
161
|
-
|
|
161
|
+
websocketUrl="wss://speech.talktopc.com/ws/conv"
|
|
162
162
|
agentId="your_agent_id"
|
|
163
163
|
appId="your_app_id"
|
|
164
164
|
onConnected={() => console.log('Connected!')}
|
|
@@ -187,7 +187,7 @@ function AdvancedVoiceChat() {
|
|
|
187
187
|
|
|
188
188
|
useEffect(() => {
|
|
189
189
|
const voiceSDK = new VoiceSDK({
|
|
190
|
-
|
|
190
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
191
191
|
agentId: 'your_agent_id',
|
|
192
192
|
appId: 'your_app_id',
|
|
193
193
|
voice: 'default',
|
|
@@ -20,7 +20,7 @@ function VoiceChatApp() {
|
|
|
20
20
|
// Initialize VoiceSDK
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
const voiceSDK = new VoiceSDK({
|
|
23
|
-
websocketUrl: 'wss://speech.
|
|
23
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
24
24
|
agentId: 'demo_agent_123',
|
|
25
25
|
appId: 'demo_app_456',
|
|
26
26
|
voice: 'default',
|
|
@@ -199,7 +199,7 @@ function VoiceChatApp() {
|
|
|
199
199
|
<div style={{ marginBottom: '20px' }}>
|
|
200
200
|
<h3>Voice Button Component:</h3>
|
|
201
201
|
<VoiceButton
|
|
202
|
-
websocketUrl="wss://speech.
|
|
202
|
+
websocketUrl="wss://speech.talktopc.com/ws/conv"
|
|
203
203
|
agentId="demo_agent_123"
|
|
204
204
|
appId="demo_app_456"
|
|
205
205
|
onConnected={() => console.log('VoiceButton connected')}
|
package/dist/examples/test.html
CHANGED
|
@@ -85,7 +85,7 @@ Test page for the widget
|
|
|
85
85
|
<li>Look for the floating voice button in the bottom-right corner</li>
|
|
86
86
|
<li>Click the button to open the widget</li>
|
|
87
87
|
<li>Click the microphone to start (will request mic permission)</li>
|
|
88
|
-
<li>Widget will connect to production backend at speech.
|
|
88
|
+
<li>Widget will connect to production backend at speech.talktopc.com</li>
|
|
89
89
|
<li>Check the status updates below</li>
|
|
90
90
|
</ol>
|
|
91
91
|
</div>
|
|
@@ -168,7 +168,7 @@ Test page for the widget
|
|
|
168
168
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
169
169
|
|
|
170
170
|
// Create a mock WebSocket URL for testing
|
|
171
|
-
const mockSignedUrl = `wss://speech.
|
|
171
|
+
const mockSignedUrl = `wss://speech.talktopc.com/ws/conv?agentId=${agentId}&appId=test_app_123`;
|
|
172
172
|
|
|
173
173
|
console.log('Generated mock session URL:', mockSignedUrl);
|
|
174
174
|
updateStatus('Mock session URL created ✓', 'success');
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
<div class="code-block">
|
|
235
235
|
<div>// VoiceSDK Usage Example</div>
|
|
236
236
|
<div>const voiceSDK = new VoiceSDK({</div>
|
|
237
|
-
<div> websocketUrl: 'wss://speech.
|
|
237
|
+
<div> websocketUrl: 'wss://speech.talktopc.com/ws/conv',</div>
|
|
238
238
|
<div> agentId: 'your_agent_id',</div>
|
|
239
239
|
<div> appId: 'your_app_id'</div>
|
|
240
240
|
<div>});</div>
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
// Initialize VoiceSDK
|
|
272
272
|
function initializeVoiceSDK() {
|
|
273
273
|
voiceSDK = new TTPAgentSDK.VoiceSDK({
|
|
274
|
-
websocketUrl: 'wss://speech.
|
|
274
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
275
275
|
agentId: 'demo_agent_123',
|
|
276
276
|
appId: 'demo_app_456',
|
|
277
277
|
voice: 'default',
|
|
@@ -425,7 +425,7 @@
|
|
|
425
425
|
// Create a simple voice button using the VanillaVoiceButton
|
|
426
426
|
const voiceButton = new TTPAgentSDK.VanillaVoiceButton({
|
|
427
427
|
container: container,
|
|
428
|
-
websocketUrl: 'wss://speech.
|
|
428
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
429
429
|
agentId: 'demo_agent_123',
|
|
430
430
|
appId: 'demo_app_456',
|
|
431
431
|
onConnected: () => {
|
package/dist/index.html
CHANGED
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
import { VoiceButton } from 'ttp-agent-sdk';
|
|
178
178
|
|
|
179
179
|
<VoiceButton
|
|
180
|
-
websocketUrl="wss://speech.
|
|
180
|
+
websocketUrl="wss://speech.talktopc.com/ws/conv"
|
|
181
181
|
agentId="your_agent_id"
|
|
182
182
|
appId="your_app_id"
|
|
183
183
|
/>
|
|
@@ -192,7 +192,7 @@ import { VoiceButton } from 'ttp-agent-sdk';
|
|
|
192
192
|
import { VoiceSDK } from 'ttp-agent-sdk';
|
|
193
193
|
|
|
194
194
|
const voiceSDK = new VoiceSDK({
|
|
195
|
-
websocketUrl: 'wss://speech.
|
|
195
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
196
196
|
agentId: 'your_agent_id',
|
|
197
197
|
appId: 'your_app_id'
|
|
198
198
|
});
|
|
@@ -98,7 +98,7 @@ function VoiceChat() {
|
|
|
98
98
|
|
|
99
99
|
useEffect(() => {
|
|
100
100
|
const voiceSDK = new VoiceSDK({
|
|
101
|
-
|
|
101
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
102
102
|
agentId: 'your_agent_id',
|
|
103
103
|
appId: 'your_app_id'
|
|
104
104
|
});
|
|
@@ -158,7 +158,7 @@ import { VoiceButton } from 'ttp-agent-sdk';
|
|
|
158
158
|
function App() {
|
|
159
159
|
return (
|
|
160
160
|
<VoiceButton
|
|
161
|
-
|
|
161
|
+
websocketUrl="wss://speech.talktopc.com/ws/conv"
|
|
162
162
|
agentId="your_agent_id"
|
|
163
163
|
appId="your_app_id"
|
|
164
164
|
onConnected={() => console.log('Connected!')}
|
|
@@ -187,7 +187,7 @@ function AdvancedVoiceChat() {
|
|
|
187
187
|
|
|
188
188
|
useEffect(() => {
|
|
189
189
|
const voiceSDK = new VoiceSDK({
|
|
190
|
-
|
|
190
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
191
191
|
agentId: 'your_agent_id',
|
|
192
192
|
appId: 'your_app_id',
|
|
193
193
|
voice: 'default',
|
|
@@ -20,7 +20,7 @@ function VoiceChatApp() {
|
|
|
20
20
|
// Initialize VoiceSDK
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
const voiceSDK = new VoiceSDK({
|
|
23
|
-
websocketUrl: 'wss://speech.
|
|
23
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
24
24
|
agentId: 'demo_agent_123',
|
|
25
25
|
appId: 'demo_app_456',
|
|
26
26
|
voice: 'default',
|
|
@@ -199,7 +199,7 @@ function VoiceChatApp() {
|
|
|
199
199
|
<div style={{ marginBottom: '20px' }}>
|
|
200
200
|
<h3>Voice Button Component:</h3>
|
|
201
201
|
<VoiceButton
|
|
202
|
-
websocketUrl="wss://speech.
|
|
202
|
+
websocketUrl="wss://speech.talktopc.com/ws/conv"
|
|
203
203
|
agentId="demo_agent_123"
|
|
204
204
|
appId="demo_app_456"
|
|
205
205
|
onConnected={() => console.log('VoiceButton connected')}
|
package/examples/test.html
CHANGED
|
@@ -85,7 +85,7 @@ Test page for the widget
|
|
|
85
85
|
<li>Look for the floating voice button in the bottom-right corner</li>
|
|
86
86
|
<li>Click the button to open the widget</li>
|
|
87
87
|
<li>Click the microphone to start (will request mic permission)</li>
|
|
88
|
-
<li>Widget will connect to production backend at speech.
|
|
88
|
+
<li>Widget will connect to production backend at speech.talktopc.com</li>
|
|
89
89
|
<li>Check the status updates below</li>
|
|
90
90
|
</ol>
|
|
91
91
|
</div>
|
|
@@ -168,7 +168,7 @@ Test page for the widget
|
|
|
168
168
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
169
169
|
|
|
170
170
|
// Create a mock WebSocket URL for testing
|
|
171
|
-
const mockSignedUrl = `wss://speech.
|
|
171
|
+
const mockSignedUrl = `wss://speech.talktopc.com/ws/conv?agentId=${agentId}&appId=test_app_123`;
|
|
172
172
|
|
|
173
173
|
console.log('Generated mock session URL:', mockSignedUrl);
|
|
174
174
|
updateStatus('Mock session URL created ✓', 'success');
|
|
@@ -234,7 +234,7 @@
|
|
|
234
234
|
<div class="code-block">
|
|
235
235
|
<div>// VoiceSDK Usage Example</div>
|
|
236
236
|
<div>const voiceSDK = new VoiceSDK({</div>
|
|
237
|
-
<div> websocketUrl: 'wss://speech.
|
|
237
|
+
<div> websocketUrl: 'wss://speech.talktopc.com/ws/conv',</div>
|
|
238
238
|
<div> agentId: 'your_agent_id',</div>
|
|
239
239
|
<div> appId: 'your_app_id'</div>
|
|
240
240
|
<div>});</div>
|
|
@@ -271,7 +271,7 @@
|
|
|
271
271
|
// Initialize VoiceSDK
|
|
272
272
|
function initializeVoiceSDK() {
|
|
273
273
|
voiceSDK = new TTPAgentSDK.VoiceSDK({
|
|
274
|
-
websocketUrl: 'wss://speech.
|
|
274
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
275
275
|
agentId: 'demo_agent_123',
|
|
276
276
|
appId: 'demo_app_456',
|
|
277
277
|
voice: 'default',
|
|
@@ -425,7 +425,7 @@
|
|
|
425
425
|
// Create a simple voice button using the VanillaVoiceButton
|
|
426
426
|
const voiceButton = new TTPAgentSDK.VanillaVoiceButton({
|
|
427
427
|
container: container,
|
|
428
|
-
websocketUrl: 'wss://speech.
|
|
428
|
+
websocketUrl: 'wss://speech.talktopc.com/ws/conv',
|
|
429
429
|
agentId: 'demo_agent_123',
|
|
430
430
|
appId: 'demo_app_456',
|
|
431
431
|
onConnected: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ttp-agent-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Comprehensive Voice Agent SDK for web integration with real-time audio, WebSocket communication, and React components",
|
|
5
5
|
"main": "dist/agent-widget.js",
|
|
6
6
|
"module": "src/index.js",
|
package/src/core/VoiceSDK.js
CHANGED
|
@@ -13,7 +13,7 @@ export default class VoiceSDK extends EventEmitter {
|
|
|
13
13
|
|
|
14
14
|
// Configuration
|
|
15
15
|
this.config = {
|
|
16
|
-
websocketUrl: config.websocketUrl || 'wss://speech.
|
|
16
|
+
websocketUrl: config.websocketUrl || 'wss://speech.talktopc.com/ws/conv',
|
|
17
17
|
agentId: config.agentId, // Optional - for direct agent access (unsecured method)
|
|
18
18
|
appId: config.appId, // User's app ID for authentication
|
|
19
19
|
ttpId: config.ttpId, // Optional - custom TTP ID (fallback if appId not provided)
|
|
@@ -6,7 +6,7 @@ import VoiceSDK from '../core/VoiceSDK.js';
|
|
|
6
6
|
export default class VoiceButton {
|
|
7
7
|
constructor(options = {}) {
|
|
8
8
|
this.options = {
|
|
9
|
-
websocketUrl: options.websocketUrl || 'wss://speech.
|
|
9
|
+
websocketUrl: options.websocketUrl || 'wss://speech.talktopc.com/ws/conv',
|
|
10
10
|
agentId: options.agentId, // Optional - for direct agent access (unsecured method)
|
|
11
11
|
voice: options.voice || 'default',
|
|
12
12
|
language: options.language || 'en',
|