Spaces:
Running
Running
Update flare-ui/src/app/components/environment/environment.component.ts
Browse files
flare-ui/src/app/components/environment/environment.component.ts
CHANGED
@@ -198,8 +198,8 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
198 |
|
199 |
<!-- STT Settings Panel -->
|
200 |
<mat-expansion-panel class="stt-settings-panel"
|
201 |
-
|
202 |
-
|
203 |
<mat-expansion-panel-header>
|
204 |
<mat-panel-title>
|
205 |
<mat-icon>settings_voice</mat-icon>
|
@@ -215,7 +215,8 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
215 |
<mat-label>Speech Timeout (ms)</mat-label>
|
216 |
<input matInput type="number"
|
217 |
name="speechTimeout"
|
218 |
-
[
|
|
|
219 |
min="500" max="5000" step="100"
|
220 |
[disabled]="loading">
|
221 |
<mat-icon matPrefix>timer</mat-icon>
|
@@ -583,7 +584,7 @@ export class EnvironmentComponent implements OnInit {
|
|
583 |
this.apiService.getEnvironment().subscribe({
|
584 |
next: (env) => {
|
585 |
this.environment = env;
|
586 |
-
// Ensure STT settings exist
|
587 |
if (!this.environment.stt_settings) {
|
588 |
this.environment.stt_settings = {
|
589 |
speech_timeout_ms: 2000,
|
@@ -608,6 +609,22 @@ export class EnvironmentComponent implements OnInit {
|
|
608 |
});
|
609 |
}
|
610 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
611 |
getTokenLabel(): string {
|
612 |
switch(this.environment.work_mode) {
|
613 |
case 'gpt4o':
|
|
|
198 |
|
199 |
<!-- STT Settings Panel -->
|
200 |
<mat-expansion-panel class="stt-settings-panel"
|
201 |
+
*ngIf="environment.stt_engine !== 'no_stt' && environment.stt_settings"
|
202 |
+
[expanded]="sttSettingsExpanded">
|
203 |
<mat-expansion-panel-header>
|
204 |
<mat-panel-title>
|
205 |
<mat-icon>settings_voice</mat-icon>
|
|
|
215 |
<mat-label>Speech Timeout (ms)</mat-label>
|
216 |
<input matInput type="number"
|
217 |
name="speechTimeout"
|
218 |
+
[ngModel]="environment.stt_settings?.speech_timeout_ms || 2000"
|
219 |
+
(ngModelChange)="updateSTTSetting('speech_timeout_ms', $event)"
|
220 |
min="500" max="5000" step="100"
|
221 |
[disabled]="loading">
|
222 |
<mat-icon matPrefix>timer</mat-icon>
|
|
|
584 |
this.apiService.getEnvironment().subscribe({
|
585 |
next: (env) => {
|
586 |
this.environment = env;
|
587 |
+
// Ensure STT settings exist with proper null check
|
588 |
if (!this.environment.stt_settings) {
|
589 |
this.environment.stt_settings = {
|
590 |
speech_timeout_ms: 2000,
|
|
|
609 |
});
|
610 |
}
|
611 |
|
612 |
+
updateSTTSetting(key: string, value: any) {
|
613 |
+
if (!this.environment.stt_settings) {
|
614 |
+
this.environment.stt_settings = {
|
615 |
+
speech_timeout_ms: 2000,
|
616 |
+
noise_reduction_level: 2,
|
617 |
+
vad_sensitivity: 0.5,
|
618 |
+
language: 'tr-TR',
|
619 |
+
model: 'latest_long',
|
620 |
+
use_enhanced: true,
|
621 |
+
enable_punctuation: true,
|
622 |
+
interim_results: true
|
623 |
+
};
|
624 |
+
}
|
625 |
+
(this.environment.stt_settings as any)[key] = value;
|
626 |
+
}
|
627 |
+
|
628 |
getTokenLabel(): string {
|
629 |
switch(this.environment.work_mode) {
|
630 |
case 'gpt4o':
|