Skip to content

Commit 339e955

Browse files
Fix minor blips in thrown errors
1 parent d7bf27b commit 339e955

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

dist/lib/conversation.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

lib/client.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ export class RealtimeClient extends RealtimeEventHandler {
417417
*/
418418
disconnect() {
419419
this.sessionCreated = false;
420-
this.conversation.clear();
421420
this.realtime.isConnected() && this.realtime.disconnect();
421+
this.conversation.clear();
422422
}
423423

424424
/**

lib/conversation.js

+3
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ export class RealtimeConversation {
126126
},
127127
'input_audio_buffer.speech_stopped': (event, inputAudioBuffer) => {
128128
const { item_id, audio_end_ms } = event;
129+
if (!this.queuedSpeechItems[item_id]) {
130+
this.queuedSpeechItems[item_id] = { audio_start_ms: audio_end_ms };
131+
}
129132
const speech = this.queuedSpeechItems[item_id];
130133
speech.audio_end_ms = audio_end_ms;
131134
if (inputAudioBuffer) {

0 commit comments

Comments
 (0)