ciyidogan commited on
Commit
32272c2
·
verified ·
1 Parent(s): 986bc93

Update flare-ui/src/app/components/environment/environment.component.ts

Browse files
flare-ui/src/app/components/environment/environment.component.ts CHANGED
@@ -113,6 +113,70 @@ import { EnvironmentService } from '../../services/environment.service';
113
  }
114
  </mat-form-field>
115
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
  <mat-expansion-panel class="prompt-panel">
117
  <mat-expansion-panel-header>
118
  <mat-panel-title>
@@ -218,6 +282,21 @@ import { EnvironmentService } from '../../services/environment.service';
218
  margin-bottom: 20px;
219
  }
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  .prompt-panel {
222
  margin-bottom: 20px;
223
 
@@ -276,7 +355,11 @@ export class EnvironmentComponent implements OnInit {
276
  work_mode: 'hfcloud',
277
  cloud_token: '',
278
  spark_endpoint: '',
279
- internal_prompt: ''
 
 
 
 
280
  };
281
 
282
  loading = true;
@@ -339,6 +422,18 @@ export class EnvironmentComponent implements OnInit {
339
  }
340
  }
341
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  save() {
343
  this.saving = true;
344
 
 
113
  }
114
  </mat-form-field>
115
 
116
+ <!-- TTS Configuration -->
117
+ <div class="engine-row">
118
+ <mat-form-field appearance="outline" class="engine-field">
119
+ <mat-label>TTS Engine</mat-label>
120
+ <mat-select
121
+ name="ttsEngine"
122
+ [(ngModel)]="environment.tts_engine"
123
+ (selectionChange)="onTTSEngineChange()"
124
+ [disabled]="loading"
125
+ >
126
+ <mat-option value="no_tts">No TTS</mat-option>
127
+ <mat-option value="elevenlabs">ElevenLabs</mat-option>
128
+ <mat-option value="blaze">Blaze (Coming Soon)</mat-option>
129
+ </mat-select>
130
+ <mat-icon matPrefix>record_voice_over</mat-icon>
131
+ </mat-form-field>
132
+
133
+ <mat-form-field appearance="outline" class="api-key-field">
134
+ <mat-label>TTS API Key</mat-label>
135
+ <input
136
+ matInput
137
+ type="password"
138
+ name="ttsApiKey"
139
+ [(ngModel)]="environment.tts_engine_api_key"
140
+ [disabled]="loading || environment.tts_engine === 'no_tts'"
141
+ [required]="environment.tts_engine !== 'no_tts'"
142
+ placeholder="Enter TTS API key"
143
+ >
144
+ <mat-icon matPrefix>key</mat-icon>
145
+ </mat-form-field>
146
+ </div>
147
+
148
+ <!-- STT Configuration -->
149
+ <div class="engine-row">
150
+ <mat-form-field appearance="outline" class="engine-field">
151
+ <mat-label>STT Engine</mat-label>
152
+ <mat-select
153
+ name="sttEngine"
154
+ [(ngModel)]="environment.stt_engine"
155
+ (selectionChange)="onSTTEngineChange()"
156
+ [disabled]="loading"
157
+ >
158
+ <mat-option value="no_stt">No STT</mat-option>
159
+ <mat-option value="elevenlabs">ElevenLabs</mat-option>
160
+ <mat-option value="flicker">Flicker (Coming Soon)</mat-option>
161
+ </mat-select>
162
+ <mat-icon matPrefix>mic</mat-icon>
163
+ </mat-form-field>
164
+
165
+ <mat-form-field appearance="outline" class="api-key-field">
166
+ <mat-label>STT API Key</mat-label>
167
+ <input
168
+ matInput
169
+ type="password"
170
+ name="sttApiKey"
171
+ [(ngModel)]="environment.stt_engine_api_key"
172
+ [disabled]="loading || environment.stt_engine === 'no_stt'"
173
+ [required]="environment.stt_engine !== 'no_stt'"
174
+ placeholder="Enter STT API key"
175
+ >
176
+ <mat-icon matPrefix>key</mat-icon>
177
+ </mat-form-field>
178
+ </div>
179
+
180
  <mat-expansion-panel class="prompt-panel">
181
  <mat-expansion-panel-header>
182
  <mat-panel-title>
 
282
  margin-bottom: 20px;
283
  }
284
 
285
+ .engine-row {
286
+ display: flex;
287
+ gap: 16px;
288
+ align-items: flex-start;
289
+ margin-bottom: 20px;
290
+
291
+ .engine-field {
292
+ flex: 1;
293
+ }
294
+
295
+ .api-key-field {
296
+ flex: 1.5;
297
+ }
298
+ }
299
+
300
  .prompt-panel {
301
  margin-bottom: 20px;
302
 
 
355
  work_mode: 'hfcloud',
356
  cloud_token: '',
357
  spark_endpoint: '',
358
+ internal_prompt: '',
359
+ tts_engine: 'no_tts',
360
+ tts_engine_api_key: '',
361
+ stt_engine: 'no_stt',
362
+ stt_engine_api_key: ''
363
  };
364
 
365
  loading = true;
 
422
  }
423
  }
424
 
425
+ onTTSEngineChange() {
426
+ if (this.environment.tts_engine === 'no_tts') {
427
+ this.environment.tts_engine_api_key = '';
428
+ }
429
+ }
430
+
431
+ onSTTEngineChange() {
432
+ if (this.environment.stt_engine === 'no_stt') {
433
+ this.environment.stt_engine_api_key = '';
434
+ }
435
+ }
436
+
437
  save() {
438
  this.saving = true;
439