@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.
|
@@ -6158,6 +6158,21 @@ registerProcessor('audio_processor', AudioProcessor);
|
|
|
6158
6158
|
});
|
|
6159
6159
|
break;
|
|
6160
6160
|
}
|
|
6161
|
+
case 'turn.end': {
|
|
6162
|
+
// Sent from the server when a turn ends
|
|
6163
|
+
if (message.role === 'user') {
|
|
6164
|
+
this._setUserSpeaking(false);
|
|
6165
|
+
}
|
|
6166
|
+
else if (message.role === 'assistant') {
|
|
6167
|
+
this._setAgentSpeaking(false);
|
|
6168
|
+
}
|
|
6169
|
+
this.options.onMessage({
|
|
6170
|
+
...message,
|
|
6171
|
+
agentSpeaking: this.agentIsSpeaking,
|
|
6172
|
+
userSpeaking: this.userIsSpeaking,
|
|
6173
|
+
});
|
|
6174
|
+
break;
|
|
6175
|
+
}
|
|
6161
6176
|
case 'response.end': {
|
|
6162
6177
|
// When audioOutput is disabled, notify server that "playback" is complete
|
|
6163
6178
|
if (!this.audioOutput && !this.sentReplayFinishedForDisabledOutput) {
|
|
@@ -6208,6 +6223,7 @@ registerProcessor('audio_processor', AudioProcessor);
|
|
|
6208
6223
|
break;
|
|
6209
6224
|
}
|
|
6210
6225
|
case 'response.text':
|
|
6226
|
+
case 'response.text.delta':
|
|
6211
6227
|
// Set turn ID from first text message if not set
|
|
6212
6228
|
if (!this.currentTurnId) {
|
|
6213
6229
|
this.currentTurnId = message.turn_id;
|