@layercode/js-sdk 2.8.8 → 2.8.9
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.
|
@@ -6152,6 +6152,21 @@ class LayercodeClient {
|
|
|
6152
6152
|
});
|
|
6153
6153
|
break;
|
|
6154
6154
|
}
|
|
6155
|
+
case 'turn.end': {
|
|
6156
|
+
// Sent from the server when a turn ends
|
|
6157
|
+
if (message.role === 'user') {
|
|
6158
|
+
this._setUserSpeaking(false);
|
|
6159
|
+
}
|
|
6160
|
+
else if (message.role === 'assistant') {
|
|
6161
|
+
this._setAgentSpeaking(false);
|
|
6162
|
+
}
|
|
6163
|
+
this.options.onMessage({
|
|
6164
|
+
...message,
|
|
6165
|
+
agentSpeaking: this.agentIsSpeaking,
|
|
6166
|
+
userSpeaking: this.userIsSpeaking,
|
|
6167
|
+
});
|
|
6168
|
+
break;
|
|
6169
|
+
}
|
|
6155
6170
|
case 'response.end': {
|
|
6156
6171
|
// When audioOutput is disabled, notify server that "playback" is complete
|
|
6157
6172
|
if (!this.audioOutput && !this.sentReplayFinishedForDisabledOutput) {
|
|
@@ -6202,6 +6217,7 @@ class LayercodeClient {
|
|
|
6202
6217
|
break;
|
|
6203
6218
|
}
|
|
6204
6219
|
case 'response.text':
|
|
6220
|
+
case 'response.text.delta':
|
|
6205
6221
|
// Set turn ID from first text message if not set
|
|
6206
6222
|
if (!this.currentTurnId) {
|
|
6207
6223
|
this.currentTurnId = message.turn_id;
|