ciyidogan commited on
Commit
2c35243
·
verified ·
1 Parent(s): 30f7ccb

Update flare-ui/src/app/services/conversation-manager.service.ts

Browse files
flare-ui/src/app/services/conversation-manager.service.ts CHANGED
@@ -607,7 +607,7 @@ export class ConversationManagerService implements OnDestroy {
607
  this.currentStateSubject.next('error');
608
  }
609
  }
610
-
611
  private handleServerError(message: any): void {
612
  const errorType = message['error_type'] || 'unknown';
613
  const errorMessage = message['message'] || 'Server error occurred';
@@ -630,6 +630,14 @@ export class ConversationManagerService implements OnDestroy {
630
  this.addSystemMessage('Session conflict detected. Please restart the conversation.');
631
  } else if (errorType === 'stt_error') {
632
  this.addSystemMessage('Speech recognition error. Please try speaking again.');
 
 
 
 
 
 
 
 
633
  } else if (errorType === 'tts_error') {
634
  this.addSystemMessage('Text-to-speech error. Response will be shown as text only.');
635
  } else {
 
607
  this.currentStateSubject.next('error');
608
  }
609
  }
610
+
611
  private handleServerError(message: any): void {
612
  const errorType = message['error_type'] || 'unknown';
613
  const errorMessage = message['message'] || 'Server error occurred';
 
630
  this.addSystemMessage('Session conflict detected. Please restart the conversation.');
631
  } else if (errorType === 'stt_error') {
632
  this.addSystemMessage('Speech recognition error. Please try speaking again.');
633
+ // STT hatası durumunda yeniden başlatmayı dene
634
+ if (errorMessage.includes('Streaming not started')) {
635
+ this.addSystemMessage('Restarting speech recognition...');
636
+ // WebSocket'e restart sinyali gönder
637
+ if (this.wsService.isConnected()) {
638
+ this.wsService.sendControl('restart_stt');
639
+ }
640
+ }
641
  } else if (errorType === 'tts_error') {
642
  this.addSystemMessage('Text-to-speech error. Response will be shown as text only.');
643
  } else {