@voice-ai-labs/web-sdk 0.9.0 → 0.9.2
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 +77 -20
- package/dist/client/analytics.d.ts +18 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +19 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +19 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ The SDK provides a unified interface for:
|
|
|
37
37
|
- [**Agent Management**](#agent-management) — Create, update, deploy, and manage agents
|
|
38
38
|
- [**Knowledge Base**](#knowledge-base) — Manage RAG documents for your agents
|
|
39
39
|
- [**Phone Numbers**](#phone-numbers) — Search and manage phone numbers
|
|
40
|
-
- [**Analytics**](#analytics) — Access call history and
|
|
40
|
+
- [**Analytics**](#analytics) — Access call history, transcripts, and recordings
|
|
41
41
|
- [**Webhooks**](#webhooks) — Receive real-time notifications for call events
|
|
42
42
|
- [**Security**](#security) — Backend token exchange, endToken, CORS
|
|
43
43
|
- [**Error Handling**](#error-handling) — Connection and API error handling
|
|
@@ -54,30 +54,13 @@ await voiceai.connect({
|
|
|
54
54
|
|
|
55
55
|
// Test mode: preview paused agents before deploying
|
|
56
56
|
await voiceai.connect({ agentId: 'agent-123', testMode: true });
|
|
57
|
-
|
|
58
|
-
// Apply safe per-call overrides to a saved agent
|
|
59
|
-
await voiceai.connect({
|
|
60
|
-
agentId: 'agent-123',
|
|
61
|
-
agentOverrides: {
|
|
62
|
-
prompt: 'You are helping with premium support only.',
|
|
63
|
-
greeting: 'Thanks for calling premium support.',
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
57
|
```
|
|
67
58
|
|
|
68
59
|
`connect()` supports these top-level request shapes:
|
|
69
60
|
|
|
70
61
|
- `agentId` for a saved agent
|
|
71
|
-
- `agentConfig` for an inline agent configuration
|
|
72
|
-
- `agentOverrides` for safe per-call overrides on a saved agent
|
|
73
62
|
- `dynamicVariables` for optional runtime variables passed at call start
|
|
74
|
-
|
|
75
|
-
These connection shapes are mutually exclusive where noted:
|
|
76
|
-
|
|
77
|
-
- Use `agentId` with optional `agentOverrides` and `dynamicVariables` for a saved agent
|
|
78
|
-
- Use `agentConfig` with optional `dynamicVariables` for an inline agent configuration
|
|
79
|
-
- Do not combine `agentId` with `agentConfig`
|
|
80
|
-
- Do not combine `agentConfig` with `agentOverrides`
|
|
63
|
+
- `testMode` to preview paused agents before deploying
|
|
81
64
|
|
|
82
65
|
### Events
|
|
83
66
|
|
|
@@ -166,6 +149,18 @@ const reader = response.body!.getReader();
|
|
|
166
149
|
// Read chunks: reader.read()
|
|
167
150
|
```
|
|
168
151
|
|
|
152
|
+
Managed pronunciation dictionaries can be attached to direct TTS requests and saved agent configs with:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
const audio = await voiceai.tts.synthesize({
|
|
156
|
+
text: 'Schedule a follow-up for Thailand.',
|
|
157
|
+
voice_id: 'voice-123',
|
|
158
|
+
language: 'en',
|
|
159
|
+
dictionary_id: 'dict-123',
|
|
160
|
+
dictionary_version: 2,
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
169
164
|
### Voice Management
|
|
170
165
|
|
|
171
166
|
```typescript
|
|
@@ -190,6 +185,55 @@ await voiceai.tts.updateVoice('voice-123', { name: 'Renamed', voice_visibility:
|
|
|
190
185
|
await voiceai.tts.deleteVoice('voice-123');
|
|
191
186
|
```
|
|
192
187
|
|
|
188
|
+
### Pronunciation Dictionaries
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
// List dictionaries
|
|
192
|
+
const dictionaries = await voiceai.tts.listPronunciationDictionaries();
|
|
193
|
+
|
|
194
|
+
// Get one dictionary
|
|
195
|
+
const dictionary = await voiceai.tts.getPronunciationDictionary('dict-123');
|
|
196
|
+
|
|
197
|
+
// Create from rules
|
|
198
|
+
const created = await voiceai.tts.createPronunciationDictionaryFromRules({
|
|
199
|
+
name: 'Medical Terms',
|
|
200
|
+
language: 'en',
|
|
201
|
+
rules: [
|
|
202
|
+
{ word: 'Thailand', replacement: 'tie-land' },
|
|
203
|
+
{ word: 'router', replacement: 'row-ter', ipa: 'ˈraʊtɚ', case_sensitive: false },
|
|
204
|
+
],
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// Create from a .pls file
|
|
208
|
+
await voiceai.tts.createPronunciationDictionaryFromFile({
|
|
209
|
+
file: dictionaryFile,
|
|
210
|
+
name: 'Imported Dictionary',
|
|
211
|
+
language: 'en',
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
// Rename
|
|
215
|
+
await voiceai.tts.updatePronunciationDictionary('dict-123', { name: 'Medical Terms v2' });
|
|
216
|
+
|
|
217
|
+
// Replace all rules
|
|
218
|
+
await voiceai.tts.setPronunciationDictionaryRules('dict-123', [
|
|
219
|
+
{ word: 'SQL', replacement: 'sequel', case_sensitive: false },
|
|
220
|
+
]);
|
|
221
|
+
|
|
222
|
+
// Add rules
|
|
223
|
+
await voiceai.tts.addPronunciationDictionaryRules('dict-123', [
|
|
224
|
+
{ word: 'gif', replacement: 'jif', case_sensitive: false },
|
|
225
|
+
]);
|
|
226
|
+
|
|
227
|
+
// Remove rules by stable rule ID
|
|
228
|
+
await voiceai.tts.removePronunciationDictionaryRules('dict-123', ['rule-1', 'rule-2']);
|
|
229
|
+
|
|
230
|
+
// Download a specific version as a Blob
|
|
231
|
+
const plsBlob = await voiceai.tts.downloadPronunciationDictionaryVersion('dict-123', 3);
|
|
232
|
+
|
|
233
|
+
// Delete
|
|
234
|
+
await voiceai.tts.deletePronunciationDictionary('dict-123');
|
|
235
|
+
```
|
|
236
|
+
|
|
193
237
|
## Agent Management
|
|
194
238
|
|
|
195
239
|
```typescript
|
|
@@ -202,6 +246,7 @@ const agent = await voiceai.agents.create({
|
|
|
202
246
|
config: {
|
|
203
247
|
prompt: 'You are a helpful customer support agent.',
|
|
204
248
|
greeting: 'Hello! How can I help you today?',
|
|
249
|
+
recording_enabled: true,
|
|
205
250
|
tts_params: {
|
|
206
251
|
voice_id: 'my-voice-id',
|
|
207
252
|
model: 'voiceai-tts-v1-latest',
|
|
@@ -237,6 +282,10 @@ await voiceai.agents.createOutboundCall({
|
|
|
237
282
|
> **Outbound access control:** `POST /api/v1/calls/outbound` is restricted to approved accounts.
|
|
238
283
|
> If you need outbound enabled for your account/workspace, please contact Voice.ai support.
|
|
239
284
|
|
|
285
|
+
> **Update behavior:** `voiceai.agents.update()` is a partial update. Omit a field to leave it unchanged. For nullable scalar fields like `prompt`, `greeting`, `phone_number`, or nested `tts_params` fields, pass `null` to clear the current value. See section-specific notes below for webhook clearing behavior.
|
|
286
|
+
|
|
287
|
+
> **Recording:** `config.recording_enabled` defaults to `true` for new agents. Set it to `false` to disable recording for future calls.
|
|
288
|
+
|
|
240
289
|
### Dynamic Variables
|
|
241
290
|
|
|
242
291
|
Pass optional `dynamic_variables` at call start and reference them in your prompt with `{{variable_name}}`:
|
|
@@ -322,6 +371,12 @@ const history = await voiceai.analytics.getCallHistory({
|
|
|
322
371
|
// Get transcript URL
|
|
323
372
|
const transcript = await voiceai.analytics.getTranscriptUrl(callId);
|
|
324
373
|
|
|
374
|
+
// Get recording status or URL
|
|
375
|
+
const recording = await voiceai.analytics.getRecordingUrl(callId);
|
|
376
|
+
if (recording.status === 'ready' && recording.url) {
|
|
377
|
+
window.open(recording.url, '_blank');
|
|
378
|
+
}
|
|
379
|
+
|
|
325
380
|
// Get stats summary
|
|
326
381
|
const stats = await voiceai.analytics.getStatsSummary();
|
|
327
382
|
```
|
|
@@ -424,12 +479,15 @@ await voiceai.agents.update(agentId, {
|
|
|
424
479
|
- `webhooks.events`
|
|
425
480
|
- Required: `url`
|
|
426
481
|
- Optional: `secret`, `events`, `timeout` (default `5`), `enabled` (default `true`)
|
|
482
|
+
- On update: omit `events` to preserve the existing event webhook, set `events: null` to remove it, set `secret: null` to clear only the signing secret, and use `events: []` to receive all event types
|
|
427
483
|
- `webhooks.inbound_call`
|
|
428
484
|
- Required: `url`
|
|
429
485
|
- Optional: `secret`, `timeout` (default `5`), `enabled` (default `true`)
|
|
486
|
+
- On update: omit `inbound_call` to preserve it, set `inbound_call: null` to remove it, and set `secret: null` to clear only the signing secret
|
|
430
487
|
- `webhooks.tools`
|
|
431
488
|
- Required per tool: `name`, `description`, `parameters`, `url`, `method`, `execution_mode`, `auth_type`
|
|
432
489
|
- Optional per tool: `auth_token`, `headers`, `response`, `timeout` (default `10`)
|
|
490
|
+
- On update: omit `tools` to leave the current tool list unchanged, set `tools: null` to clear all tools, or pass a new array to replace the current list
|
|
433
491
|
|
|
434
492
|
If a field is optional and omitted, the service uses the documented default. Prefer omitting optional fields instead of sending `null` unless you explicitly intend to clear behavior in a supported way.
|
|
435
493
|
|
|
@@ -539,7 +597,6 @@ Your endpoint should respond with:
|
|
|
539
597
|
```typescript
|
|
540
598
|
interface InboundCallWebhookResponse {
|
|
541
599
|
dynamic_variables?: Record<string, string | number | boolean>;
|
|
542
|
-
agent_overrides?: Record<string, unknown>;
|
|
543
600
|
}
|
|
544
601
|
```
|
|
545
602
|
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Provides methods for:
|
|
5
5
|
* - Getting call history with filters
|
|
6
6
|
* - Getting transcript URLs
|
|
7
|
+
* - Getting recording status and URLs
|
|
7
8
|
* - Getting agent stats summary
|
|
8
9
|
*/
|
|
9
10
|
import { BaseClient, BaseClientConfig } from './base';
|
|
10
|
-
import type { PaginatedCallHistoryResponse, GetCallHistoryOptions, TranscriptResponse, AgentStatsSummaryResponse } from '../types';
|
|
11
|
+
import type { PaginatedCallHistoryResponse, GetCallHistoryOptions, TranscriptResponse, RecordingResponse, AgentStatsSummaryResponse } from '../types';
|
|
11
12
|
/**
|
|
12
13
|
* Client for analytics and reporting operations
|
|
13
14
|
*/
|
|
@@ -58,6 +59,22 @@ export declare class AnalyticsClient extends BaseClient {
|
|
|
58
59
|
* ```
|
|
59
60
|
*/
|
|
60
61
|
getTranscriptUrl(callId: string): Promise<TranscriptResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* Get recording status or download URL for a call
|
|
64
|
+
*
|
|
65
|
+
* @param callId - The call identifier
|
|
66
|
+
* @returns Object with recording status and optional URL
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const recording = await client.analytics.getRecordingUrl("call_12345");
|
|
71
|
+
*
|
|
72
|
+
* if (recording.status === 'ready' && recording.url) {
|
|
73
|
+
* window.open(recording.url, '_blank');
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
getRecordingUrl(callId: string): Promise<RecordingResponse>;
|
|
61
78
|
/**
|
|
62
79
|
* Get agent stats summary
|
|
63
80
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU;gBACjC,MAAM,EAAE,gBAAgB;IAIpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAY5F;;;;;;;;;;;;;OAaG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAInE;;;;;;;;;;;;;;OAcG;IACG,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIjE;;;;;;;;;;;;;OAaG;IACG,eAAe,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAG5D"}
|
package/dist/client/analytics.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Provides methods for:
|
|
5
5
|
* - Getting call history with filters
|
|
6
6
|
* - Getting transcript URLs
|
|
7
|
+
* - Getting recording status and URLs
|
|
7
8
|
* - Getting agent stats summary
|
|
8
9
|
*/
|
|
9
10
|
import { BaseClient } from './base';
|
|
@@ -74,6 +75,24 @@ export class AnalyticsClient extends BaseClient {
|
|
|
74
75
|
async getTranscriptUrl(callId) {
|
|
75
76
|
return this.get(`/agent/call-history/${callId}/transcript`);
|
|
76
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Get recording status or download URL for a call
|
|
80
|
+
*
|
|
81
|
+
* @param callId - The call identifier
|
|
82
|
+
* @returns Object with recording status and optional URL
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const recording = await client.analytics.getRecordingUrl("call_12345");
|
|
87
|
+
*
|
|
88
|
+
* if (recording.status === 'ready' && recording.url) {
|
|
89
|
+
* window.open(recording.url, '_blank');
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
async getRecordingUrl(callId) {
|
|
94
|
+
return this.get(`/agent/call-history/${callId}/recording`);
|
|
95
|
+
}
|
|
77
96
|
/**
|
|
78
97
|
* Get agent stats summary
|
|
79
98
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/client/analytics.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+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AK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAC,GAAG,CAA4B,sBAAsB,CAAC,CAAC;IACrE,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -238,7 +238,7 @@ export declare class VoiceAI {
|
|
|
238
238
|
export default VoiceAI;
|
|
239
239
|
/** Error class for API errors */
|
|
240
240
|
export { VoiceAIError } from './client/base';
|
|
241
|
-
export type { VoiceAIConfig, ConnectionOptions, ConnectionDetails, ConnectionStatus, TranscriptionSegment, AgentState, AgentStateInfo, AudioLevelInfo, MicrophoneState, Agent, VoiceResponse, VoiceStatus, } from './types';
|
|
241
|
+
export type { VoiceAIConfig, ConnectionOptions, ConnectionDetails, ConnectionStatus, TranscriptionSegment, AgentState, AgentStateInfo, AudioLevelInfo, MicrophoneState, Agent, VoiceResponse, VoiceStatus, RecordingStatus, } from './types';
|
|
242
242
|
/**
|
|
243
243
|
* Generate optimized audio capture options for voice agents
|
|
244
244
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAEjB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EAEnB,cAAc,EAEd,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACd,MAAM,SAAS,CAAC;AAKj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C,mBAAmB;CAG5B;AAMD,yCAAyC;AACzC,eAAe,OAAO,CAAC;AAEvB,iCAAiC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAS7C,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,KAAK,EACL,aAAa,EACb,WAAW,EACX,eAAe,GAChB,MAAM,SAAS,CAAC;AAMjB;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAmBvG;AAMD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -27787,6 +27787,7 @@ class AgentClient extends BaseClient {
|
|
|
27787
27787
|
* Provides methods for:
|
|
27788
27788
|
* - Getting call history with filters
|
|
27789
27789
|
* - Getting transcript URLs
|
|
27790
|
+
* - Getting recording status and URLs
|
|
27790
27791
|
* - Getting agent stats summary
|
|
27791
27792
|
*/
|
|
27792
27793
|
/**
|
|
@@ -27856,6 +27857,24 @@ class AnalyticsClient extends BaseClient {
|
|
|
27856
27857
|
async getTranscriptUrl(callId) {
|
|
27857
27858
|
return this.get(`/agent/call-history/${callId}/transcript`);
|
|
27858
27859
|
}
|
|
27860
|
+
/**
|
|
27861
|
+
* Get recording status or download URL for a call
|
|
27862
|
+
*
|
|
27863
|
+
* @param callId - The call identifier
|
|
27864
|
+
* @returns Object with recording status and optional URL
|
|
27865
|
+
*
|
|
27866
|
+
* @example
|
|
27867
|
+
* ```typescript
|
|
27868
|
+
* const recording = await client.analytics.getRecordingUrl("call_12345");
|
|
27869
|
+
*
|
|
27870
|
+
* if (recording.status === 'ready' && recording.url) {
|
|
27871
|
+
* window.open(recording.url, '_blank');
|
|
27872
|
+
* }
|
|
27873
|
+
* ```
|
|
27874
|
+
*/
|
|
27875
|
+
async getRecordingUrl(callId) {
|
|
27876
|
+
return this.get(`/agent/call-history/${callId}/recording`);
|
|
27877
|
+
}
|
|
27859
27878
|
/**
|
|
27860
27879
|
* Get agent stats summary
|
|
27861
27880
|
*
|