@trillet-ai/web-sdk 1.2.12 → 1.2.14
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/dist/index.js +6 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55,12 +55,10 @@ export class TrilletAgent extends EventEmitter {
|
|
|
55
55
|
method: 'POST',
|
|
56
56
|
headers: {
|
|
57
57
|
'Content-Type': 'application/json',
|
|
58
|
-
'Accept': 'application/json'
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
workspace_id: this.config.workspaceId
|
|
63
|
-
})
|
|
58
|
+
'Accept': 'application/json',
|
|
59
|
+
'x-api-key': this.config.apiKey,
|
|
60
|
+
'x-workspace-id': this.config.workspaceId
|
|
61
|
+
}
|
|
64
62
|
});
|
|
65
63
|
if (!response.ok) {
|
|
66
64
|
let errorMessage;
|
|
@@ -115,7 +113,7 @@ export class TrilletAgent extends EventEmitter {
|
|
|
115
113
|
if (!data.token || !data.roomName) {
|
|
116
114
|
throw new Error('Invalid response from server: missing token or room name');
|
|
117
115
|
}
|
|
118
|
-
//
|
|
116
|
+
// Initialize call with LiveKit token
|
|
119
117
|
await this.sdk.initializeCall({
|
|
120
118
|
token: data.token,
|
|
121
119
|
wsUrl: process.env.LIVEKIT_WS_URL || 'wss://trillet-ai-xdx0dw5r.livekit.cloud',
|
|
@@ -126,7 +124,7 @@ export class TrilletAgent extends EventEmitter {
|
|
|
126
124
|
enableRawAudio: this.config.mode === 'voice'
|
|
127
125
|
}
|
|
128
126
|
});
|
|
129
|
-
//
|
|
127
|
+
// Enable audio playback for voice mode
|
|
130
128
|
if (this.config.mode === 'voice') {
|
|
131
129
|
await this.sdk.enableAudioPlayback();
|
|
132
130
|
}
|