@hamsa-ai/voice-agents-sdk 0.4.0-beta.9 → 0.4.1-beta.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.
- package/README.md +6 -9
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -2
- package/types/classes/livekit-analytics.d.ts +61 -3
- package/types/classes/livekit-manager.d.ts +5 -5
- package/types/classes/livekit-tool-registry.d.ts +1 -66
- package/types/classes/types.d.ts +11 -23
- package/types/main.d.ts +74 -1
package/README.md
CHANGED
|
@@ -353,13 +353,10 @@ const connectionStats = agent.getConnectionStats();
|
|
|
353
353
|
console.log(connectionStats);
|
|
354
354
|
/*
|
|
355
355
|
{
|
|
356
|
-
latency: 45, // Network latency in ms
|
|
357
|
-
packetLoss: 0.1, // Packet loss percentage
|
|
358
|
-
bandwidth: 128000, // Current bandwidth usage
|
|
359
356
|
quality: 'good', // Connection quality: excellent/good/poor/lost
|
|
360
|
-
jitter: 2, // Network jitter
|
|
361
357
|
connectionAttempts: 1, // Total connection attempts
|
|
362
358
|
reconnectionAttempts: 0, // Reconnection attempts
|
|
359
|
+
connectionEstablishedTime: 250, // Time to establish connection (ms)
|
|
363
360
|
isConnected: true // Current connection status
|
|
364
361
|
}
|
|
365
362
|
*/
|
|
@@ -386,10 +383,10 @@ console.log(performance);
|
|
|
386
383
|
/*
|
|
387
384
|
{
|
|
388
385
|
responseTime: 1200, // Total response time
|
|
389
|
-
networkLatency: 45, // Network round-trip time
|
|
390
386
|
callDuration: 60000, // Current call duration (ms)
|
|
391
387
|
connectionEstablishedTime: 250, // Time to establish connection
|
|
392
|
-
reconnectionCount: 0
|
|
388
|
+
reconnectionCount: 0, // Number of reconnections
|
|
389
|
+
averageResponseTime: 1200 // Average response time
|
|
393
390
|
}
|
|
394
391
|
*/
|
|
395
392
|
|
|
@@ -426,7 +423,7 @@ const analytics = agent.getCallAnalytics();
|
|
|
426
423
|
console.log(analytics);
|
|
427
424
|
/*
|
|
428
425
|
{
|
|
429
|
-
connectionStats: {
|
|
426
|
+
connectionStats: { quality: 'good', connectionAttempts: 1, isConnected: true, ... },
|
|
430
427
|
audioMetrics: { userAudioLevel: 0.8, agentAudioLevel: 0.3, ... },
|
|
431
428
|
performanceMetrics: { callDuration: 60000, responseTime: 1200, ... },
|
|
432
429
|
participants: [{ identity: 'agent', sid: 'participant-sid', ... }],
|
|
@@ -454,8 +451,8 @@ const updateDashboard = () => {
|
|
|
454
451
|
const performance = agent.getPerformanceMetrics();
|
|
455
452
|
|
|
456
453
|
// Update UI elements
|
|
457
|
-
document.getElementById("latency").textContent = `${stats.latency}ms`;
|
|
458
454
|
document.getElementById("quality").textContent = stats.quality;
|
|
455
|
+
document.getElementById("attempts").textContent = stats.connectionAttempts;
|
|
459
456
|
document.getElementById("duration").textContent = `${Math.floor(
|
|
460
457
|
performance.callDuration / 1000
|
|
461
458
|
)}s`;
|
|
@@ -625,7 +622,7 @@ await agent.start({
|
|
|
625
622
|
|
|
626
623
|
// Strongly typed event handlers
|
|
627
624
|
agent.on("analyticsUpdated", (analytics: CallAnalyticsResult) => {
|
|
628
|
-
console.log(analytics.connectionStats.
|
|
625
|
+
console.log(analytics.connectionStats.quality); // string
|
|
629
626
|
console.log(analytics.audioMetrics.userAudioLevel); // number
|
|
630
627
|
console.log(analytics.performanceMetrics.callDuration); // number
|
|
631
628
|
console.log(analytics.participants.length); // number
|