@voice-ai-labs/web-sdk 1.0.2 → 1.0.3
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 +11 -10
- package/dist/index.esm.js +3869 -747
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3869 -747
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -420,13 +420,14 @@ Notes:
|
|
|
420
420
|
|
|
421
421
|
### Dynamic Variables
|
|
422
422
|
|
|
423
|
-
Pass optional `dynamic_variables` at call start and reference them in your prompt with `{{variable_name}}`:
|
|
423
|
+
Pass optional `dynamic_variables` at call start and reference them in your prompt or greeting with `{{variable_name}}`:
|
|
424
424
|
|
|
425
425
|
```typescript
|
|
426
426
|
await voiceai.agents.update(agent.agent_id, {
|
|
427
427
|
config: {
|
|
428
428
|
allow_outbound_calling: true,
|
|
429
|
-
prompt: 'You are helping {{customer_name}} with order {{order_id}}.'
|
|
429
|
+
prompt: 'You are helping {{customer_name}} with order {{order_id}} for the {{account_tier}} account.',
|
|
430
|
+
greeting: 'Hi {{customer_name}}, I can help with your {{city}} delivery today.'
|
|
430
431
|
}
|
|
431
432
|
});
|
|
432
433
|
|
|
@@ -434,15 +435,18 @@ await voiceai.connect({
|
|
|
434
435
|
agentId: agent.agent_id,
|
|
435
436
|
dynamicVariables: {
|
|
436
437
|
customer_name: 'Alice',
|
|
437
|
-
order_id: '12345'
|
|
438
|
+
order_id: '12345',
|
|
439
|
+
account_tier: 'gold',
|
|
440
|
+
city: 'Seattle'
|
|
438
441
|
}
|
|
439
442
|
});
|
|
440
443
|
```
|
|
441
444
|
|
|
442
445
|
- `dynamic_variables` must be a flat object of string, number, or boolean values.
|
|
443
446
|
- Extra variables are allowed.
|
|
444
|
-
- Variables that are not referenced by the runtime prompt are ignored.
|
|
445
|
-
- The runtime is responsible for interpolating these variables into the prompt.
|
|
447
|
+
- Variables that are not referenced by the runtime prompt or greeting are ignored.
|
|
448
|
+
- The runtime is responsible for interpolating these variables into the prompt and greeting.
|
|
449
|
+
- If the same placeholder appears multiple times, the same runtime value is used for every occurrence.
|
|
446
450
|
|
|
447
451
|
### Runtime Agent Overrides
|
|
448
452
|
|
|
@@ -457,8 +461,7 @@ await voiceai.connect({
|
|
|
457
461
|
agentOverrides: {
|
|
458
462
|
tts_params: {
|
|
459
463
|
voice_id: 'voice_vip_alice',
|
|
460
|
-
|
|
461
|
-
language: 'en',
|
|
464
|
+
temperature: 0.8,
|
|
462
465
|
},
|
|
463
466
|
},
|
|
464
467
|
});
|
|
@@ -467,7 +470,7 @@ await voiceai.connect({
|
|
|
467
470
|
- `agentOverrides` is separate from `dynamicVariables`.
|
|
468
471
|
- `dynamicVariables` is for prompt and greeting interpolation.
|
|
469
472
|
- `agentOverrides` is for allowlisted runtime config changes.
|
|
470
|
-
- v1 supports only `tts_params.voice_id`, `
|
|
473
|
+
- v1 supports only `tts_params.voice_id`, `temperature`, `top_p`, `dictionary_id`, and `dictionary_version`.
|
|
471
474
|
- `agentOverrides` uses the same nested shape as agent config, so voice overrides live under `tts_params`.
|
|
472
475
|
|
|
473
476
|
## Knowledge Base
|
|
@@ -769,8 +772,6 @@ interface InboundCallWebhookResponse {
|
|
|
769
772
|
agent_overrides?: {
|
|
770
773
|
tts_params?: {
|
|
771
774
|
voice_id?: string;
|
|
772
|
-
model?: string;
|
|
773
|
-
language?: string;
|
|
774
775
|
temperature?: number;
|
|
775
776
|
top_p?: number;
|
|
776
777
|
dictionary_id?: string;
|