@cemscale-voip/voip-sdk 1.47.0 → 1.48.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.
Files changed (2) hide show
  1. package/README.md +48 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -330,6 +330,54 @@ const health = await voip.aiAgentsHealth();
330
330
  console.log(health.status); // 'connected'
331
331
  ```
332
332
 
333
+
334
+
335
+ #### All Editable Agent Fields
336
+
337
+ Every field below can be updated via `updateAiAgent()`. Only include the fields you want to change — omitted fields keep their current values.
338
+
339
+ ```typescript
340
+ await voip.updateAiAgent('my-agent', {
341
+ // ─── Identity ─────────────────────────────────
342
+ display_name: 'Sofia', // Agent's spoken name
343
+ company: 'Acme Corp', // Company the agent represents
344
+ role: 'Sales Representative', // Agent's role/title
345
+ language: 'es', // BCP-47 language code
346
+
347
+ // ─── Voice ────────────────────────────────────
348
+ voice: 'Sulafat', // Chirp 3 HD voice (use listAiVoices())
349
+
350
+ // ─── Behavior ─────────────────────────────────
351
+ speak_first: true, // Agent speaks first on connect
352
+ max_duration_s: 600, // Max call length (seconds)
353
+ idle_timeout_s: 30, // Silence timeout (seconds)
354
+ enable_transcription: false, // Real-time transcription
355
+
356
+ // ─── AI Model ─────────────────────────────────
357
+ temperature: 0.5, // 0-2, lower = more deterministic
358
+ thinking_level: 'minimal', // 'minimal' | 'medium' | 'high'
359
+ system_prompt: '...', // Full system prompt text
360
+
361
+ // ─── Tools ────────────────────────────────────
362
+ tools: [ // Available functions during calls
363
+ 'transfer_to_human', // Transfer to human (built-in)
364
+ 'end_call', // End call (built-in)
365
+ 'create_lead', // Create CRM lead (webhook)
366
+ 'leave_message', // Save message (webhook)
367
+ 'schedule_appointment', // Book appointment (webhook)
368
+ 'send_sms', // Send SMS (webhook)
369
+ 'check_policy_status', // Look up policy (webhook)
370
+ ],
371
+ tools_webhook_url: 'https://your-crm.com/api/webhooks/ai-tools',
372
+
373
+ // ─── Messages ─────────────────────────────────
374
+ greeting: 'Hello! How can I help?', // Override speak_first greeting
375
+ farewell: 'Thanks for calling!', // Override farewell message
376
+ });
377
+ ```
378
+
379
+ **Clearing fields:** Send `null` to clear string fields (`system_prompt: null`, `tools_webhook_url: null`). Send `[]` to clear tools. Number and boolean fields cannot be nulled — send the default value instead.
380
+
333
381
  #### Assigning an AI Agent to a Phone Number
334
382
 
335
383
  After creating an agent, link it to a DID so inbound calls are answered by the AI:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cemscale-voip/voip-sdk",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "description": "VoIP SDK for CemScale multi-tenant platform — API client, WebRTC, React hooks",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",