Spaces:
Building
Building
Update flare-ui/src/app/components/environment/environment.component.ts
Browse files
flare-ui/src/app/components/environment/environment.component.ts
CHANGED
@@ -210,117 +210,122 @@ import { EnvironmentService } from '../../services/environment.service';
|
|
210 |
</mat-panel-description>
|
211 |
</mat-expansion-panel-header>
|
212 |
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
</mat-form-field>
|
225 |
-
|
226 |
-
<mat-form-field appearance="outline">
|
227 |
-
<mat-label>Noise Reduction Level</mat-label>
|
228 |
-
<mat-select name="noiseReduction"
|
229 |
-
[value]="sttSettings.noise_reduction_level"
|
230 |
-
(selectionChange)="updateSTTSetting('noise_reduction_level', $event.value)"
|
231 |
-
[disabled]="loading">
|
232 |
-
<mat-option [value]="0">Off</mat-option>
|
233 |
-
<mat-option [value]="1">Low</mat-option>
|
234 |
-
<mat-option [value]="2">Medium</mat-option>
|
235 |
-
<mat-option [value]="3">High</mat-option>
|
236 |
-
</mat-select>
|
237 |
-
<mat-icon matPrefix>noise_aware</mat-icon>
|
238 |
-
</mat-form-field>
|
239 |
-
|
240 |
-
<mat-form-field appearance="outline" class="full-width">
|
241 |
-
<mat-label>VAD Sensitivity</mat-label>
|
242 |
-
<mat-slider min="0" max="1" step="0.1"
|
243 |
-
[discrete]="true"
|
244 |
-
[displayWith]="formatVAD">
|
245 |
-
<input matSliderThumb
|
246 |
-
name="vadSensitivity"
|
247 |
-
[value]="sttSettings.vad_sensitivity"
|
248 |
-
(input)="updateSTTSetting('vad_sensitivity', +$any($event.target).value)"
|
249 |
[disabled]="loading">
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
</mat-form-field>
|
254 |
-
|
255 |
-
<mat-form-field appearance="outline">
|
256 |
-
<mat-label>Language</mat-label>
|
257 |
-
<mat-select name="sttLanguage"
|
258 |
-
[value]="sttSettings.language"
|
259 |
-
(selectionChange)="updateSTTSetting('language', $event.value)"
|
260 |
-
[disabled]="loading">
|
261 |
-
<mat-option value="tr-TR">Turkish (tr-TR)</mat-option>
|
262 |
-
<mat-option value="en-US">English (en-US)</mat-option>
|
263 |
-
<mat-option value="de-DE">German (de-DE)</mat-option>
|
264 |
-
<mat-option value="fr-FR">French (fr-FR)</mat-option>
|
265 |
-
<mat-option value="es-ES">Spanish (es-ES)</mat-option>
|
266 |
-
</mat-select>
|
267 |
-
<mat-icon matPrefix>language</mat-icon>
|
268 |
-
</mat-form-field>
|
269 |
-
|
270 |
-
<mat-form-field appearance="outline"
|
271 |
-
*ngIf="environment.stt_engine === 'google'">
|
272 |
-
<mat-label>Model</mat-label>
|
273 |
-
<mat-select name="sttModel"
|
274 |
-
[value]="sttSettings.model"
|
275 |
-
(selectionChange)="updateSTTSetting('model', $event.value)"
|
276 |
-
[disabled]="loading">
|
277 |
-
<mat-option value="latest_long">Latest Long (Best for conversations)</mat-option>
|
278 |
-
<mat-option value="command_and_search">Command & Search (Short queries)</mat-option>
|
279 |
-
<mat-option value="phone_call">Phone Call (Telephony)</mat-option>
|
280 |
-
<mat-option value="video">Video (Multiple speakers)</mat-option>
|
281 |
-
</mat-select>
|
282 |
-
<mat-icon matPrefix>model_training</mat-icon>
|
283 |
-
</mat-form-field>
|
284 |
-
|
285 |
-
<div class="checkbox-group">
|
286 |
-
<mat-checkbox name="useEnhanced"
|
287 |
-
[checked]="sttSettings.use_enhanced"
|
288 |
-
(change)="updateSTTSetting('use_enhanced', $event.checked)"
|
289 |
-
[disabled]="loading || environment.stt_engine !== 'google'">
|
290 |
-
Use Enhanced Model
|
291 |
-
<mat-icon matTooltip="Better accuracy but higher cost" class="info-icon">info</mat-icon>
|
292 |
-
</mat-checkbox>
|
293 |
|
294 |
-
<mat-
|
295 |
-
|
296 |
-
|
|
|
|
|
297 |
[disabled]="loading">
|
298 |
-
|
299 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
300 |
|
301 |
-
<mat-
|
302 |
-
|
303 |
-
|
|
|
|
|
304 |
[disabled]="loading">
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
<
|
315 |
-
|
316 |
-
<
|
317 |
-
<
|
318 |
-
|
319 |
-
|
320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
</div>
|
322 |
-
|
323 |
-
|
|
|
324 |
|
325 |
<mat-expansion-panel class="prompt-panel">
|
326 |
<mat-expansion-panel-header>
|
|
|
210 |
</mat-panel-description>
|
211 |
</mat-expansion-panel-header>
|
212 |
|
213 |
+
<!-- Panel içeriğini ngIf ile kontrol et -->
|
214 |
+
<ng-container *ngIf="environment.stt_settings && sttSettingsExpanded">
|
215 |
+
<div class="stt-settings-grid">
|
216 |
+
|
217 |
+
<mat-form-field appearance="outline">
|
218 |
+
<mat-label>Speech Timeout (ms)</mat-label>
|
219 |
+
<input matInput type="number"
|
220 |
+
name="speechTimeout"
|
221 |
+
[value]="sttSettings.speech_timeout_ms"
|
222 |
+
(input)="updateSTTSetting('speech_timeout_ms', +$any($event.target).value)"
|
223 |
+
min="500" max="5000" step="100"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
[disabled]="loading">
|
225 |
+
<mat-icon matPrefix>timer</mat-icon>
|
226 |
+
<mat-hint>Silence duration to end speech (500-5000ms)</mat-hint>
|
227 |
+
</mat-form-field>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
228 |
|
229 |
+
<mat-form-field appearance="outline">
|
230 |
+
<mat-label>Noise Reduction Level</mat-label>
|
231 |
+
<mat-select name="noiseReduction"
|
232 |
+
[value]="sttSettings.noise_reduction_level"
|
233 |
+
(selectionChange)="updateSTTSetting('noise_reduction_level', $event.value)"
|
234 |
[disabled]="loading">
|
235 |
+
<mat-option [value]="0">Off</mat-option>
|
236 |
+
<mat-option [value]="1">Low</mat-option>
|
237 |
+
<mat-option [value]="2">Medium</mat-option>
|
238 |
+
<mat-option [value]="3">High</mat-option>
|
239 |
+
</mat-select>
|
240 |
+
<mat-icon matPrefix>noise_aware</mat-icon>
|
241 |
+
</mat-form-field>
|
242 |
+
|
243 |
+
<mat-form-field appearance="outline" class="full-width">
|
244 |
+
<mat-label>VAD Sensitivity</mat-label>
|
245 |
+
<mat-slider min="0" max="1" step="0.1"
|
246 |
+
[discrete]="true"
|
247 |
+
[displayWith]="formatVAD">
|
248 |
+
<input matSliderThumb
|
249 |
+
name="vadSensitivity"
|
250 |
+
[value]="sttSettings.vad_sensitivity"
|
251 |
+
(input)="updateSTTSetting('vad_sensitivity', +$any($event.target).value)"
|
252 |
+
[disabled]="loading">
|
253 |
+
</mat-slider>
|
254 |
+
<mat-icon matPrefix>graphic_eq</mat-icon>
|
255 |
+
<mat-hint>Voice activity detection sensitivity (0=low, 1=high)</mat-hint>
|
256 |
+
</mat-form-field>
|
257 |
|
258 |
+
<mat-form-field appearance="outline">
|
259 |
+
<mat-label>Language</mat-label>
|
260 |
+
<mat-select name="sttLanguage"
|
261 |
+
[value]="sttSettings.language"
|
262 |
+
(selectionChange)="updateSTTSetting('language', $event.value)"
|
263 |
[disabled]="loading">
|
264 |
+
<mat-option value="tr-TR">Turkish (tr-TR)</mat-option>
|
265 |
+
<mat-option value="en-US">English (en-US)</mat-option>
|
266 |
+
<mat-option value="de-DE">German (de-DE)</mat-option>
|
267 |
+
<mat-option value="fr-FR">French (fr-FR)</mat-option>
|
268 |
+
<mat-option value="es-ES">Spanish (es-ES)</mat-option>
|
269 |
+
</mat-select>
|
270 |
+
<mat-icon matPrefix>language</mat-icon>
|
271 |
+
</mat-form-field>
|
272 |
+
|
273 |
+
<mat-form-field appearance="outline"
|
274 |
+
*ngIf="environment.stt_engine === 'google'">
|
275 |
+
<mat-label>Model</mat-label>
|
276 |
+
<mat-select name="sttModel"
|
277 |
+
[value]="sttSettings.model"
|
278 |
+
(selectionChange)="updateSTTSetting('model', $event.value)"
|
279 |
+
[disabled]="loading">
|
280 |
+
<mat-option value="latest_long">Latest Long (Best for conversations)</mat-option>
|
281 |
+
<mat-option value="command_and_search">Command & Search (Short queries)</mat-option>
|
282 |
+
<mat-option value="phone_call">Phone Call (Telephony)</mat-option>
|
283 |
+
<mat-option value="video">Video (Multiple speakers)</mat-option>
|
284 |
+
</mat-select>
|
285 |
+
<mat-icon matPrefix>model_training</mat-icon>
|
286 |
+
</mat-form-field>
|
287 |
+
|
288 |
+
<div class="checkbox-group">
|
289 |
+
<mat-checkbox name="useEnhanced"
|
290 |
+
[checked]="sttSettings.use_enhanced"
|
291 |
+
(change)="updateSTTSetting('use_enhanced', $event.checked)"
|
292 |
+
[disabled]="loading || environment.stt_engine !== 'google'">
|
293 |
+
Use Enhanced Model
|
294 |
+
<mat-icon matTooltip="Better accuracy but higher cost" class="info-icon">info</mat-icon>
|
295 |
+
</mat-checkbox>
|
296 |
+
|
297 |
+
<mat-checkbox name="enablePunctuation"
|
298 |
+
[checked]="sttSettings.enable_punctuation"
|
299 |
+
(change)="updateSTTSetting('enable_punctuation', $event.checked)"
|
300 |
+
[disabled]="loading">
|
301 |
+
Automatic Punctuation
|
302 |
+
</mat-checkbox>
|
303 |
+
|
304 |
+
<mat-checkbox name="interimResults"
|
305 |
+
[checked]="sttSettings.interim_results"
|
306 |
+
(change)="updateSTTSetting('interim_results', $event.checked)"
|
307 |
+
[disabled]="loading">
|
308 |
+
Show Interim Results
|
309 |
+
</mat-checkbox>
|
310 |
+
</div>
|
311 |
+
</div>
|
312 |
+
|
313 |
+
<div class="stt-info-card" *ngIf="environment.stt_engine === 'google'">
|
314 |
+
<mat-icon>info</mat-icon>
|
315 |
+
<div>
|
316 |
+
<strong>Google Cloud Setup Required:</strong>
|
317 |
+
<ol>
|
318 |
+
<li>Create a Google Cloud project</li>
|
319 |
+
<li>Enable Speech-to-Text API</li>
|
320 |
+
<li>Create service account & download JSON key</li>
|
321 |
+
<li>Upload JSON key file as STT API Key</li>
|
322 |
+
</ol>
|
323 |
+
<p class="cost-info">Cost: ~$0.024/minute (standard), ~$0.036/minute (enhanced)</p>
|
324 |
+
</div>
|
325 |
</div>
|
326 |
+
|
327 |
+
</ng-container>
|
328 |
+
</mat-expansion-panel>
|
329 |
|
330 |
<mat-expansion-panel class="prompt-panel">
|
331 |
<mat-expansion-panel-header>
|