ciyidogan commited on
Commit
69e43ed
·
verified ·
1 Parent(s): a1d47a0

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

Browse files
flare-ui/src/app/components/environment/environment.component.html CHANGED
@@ -23,7 +23,7 @@
23
 
24
  <mat-form-field appearance="outline" class="full-width">
25
  <mat-label>Provider</mat-label>
26
- <mat-icon matPrefix>{{ getLLMProviderIcon(currentLLMProvider || {}) }}</mat-icon>
27
  <mat-select formControlName="llm_provider_name"
28
  (selectionChange)="onLLMProviderChange($event.value)">
29
  @for (provider of llmProviders; track provider.name) {
@@ -33,12 +33,12 @@
33
  </mat-option>
34
  }
35
  </mat-select>
36
- @if (currentLLMProvider?.description) {
37
- <mat-hint>{{ currentLLMProvider.description }}</mat-hint>
38
  }
39
  </mat-form-field>
40
 
41
- @if (currentLLMProvider?.requires_api_key) {
42
  <mat-form-field appearance="outline" class="full-width">
43
  <mat-label>{{ getApiKeyLabel('llm') }}</mat-label>
44
  <mat-icon matPrefix>key</mat-icon>
@@ -47,12 +47,12 @@
47
  formControlName="llm_provider_api_key"
48
  [placeholder]="getApiKeyPlaceholder('llm')">
49
  <mat-error *ngIf="form.get('llm_provider_api_key')?.hasError('required')">
50
- API key is required for {{ currentLLMProvider?.display_name }}
51
  </mat-error>
52
  </mat-form-field>
53
  }
54
 
55
- @if (currentLLMProvider?.requires_endpoint) {
56
  <mat-form-field appearance="outline" class="full-width">
57
  <mat-label>Endpoint URL</mat-label>
58
  <mat-icon matPrefix>link</mat-icon>
@@ -66,13 +66,13 @@
66
  <mat-icon>wifi_tethering</mat-icon>
67
  </button>
68
  <mat-error *ngIf="form.get('llm_provider_endpoint')?.hasError('required')">
69
- Endpoint is required for {{ currentLLMProvider?.display_name }}
70
  </mat-error>
71
  </mat-form-field>
72
  }
73
 
74
  <!-- LLM Settings (Internal Prompt & Parameter Collection) -->
75
- @if (currentLLMProvider) {
76
  <mat-expansion-panel class="settings-panel">
77
  <mat-expansion-panel-header>
78
  <mat-panel-title>
@@ -86,16 +86,16 @@
86
 
87
  <div class="panel-content">
88
  <p class="hint-text">
89
- This prompt is prepended to all intent detection requests.
90
- Use placeholders: &lt;intent names&gt;, &lt;intent captions&gt;, &lt;project language&gt;
91
  </p>
92
  <mat-form-field appearance="outline" class="full-width">
93
  <mat-label>Internal Prompt</mat-label>
94
  <textarea matInput
95
  [(ngModel)]="internalPrompt"
96
  [ngModelOptions]="{standalone: true}"
97
- rows="6"
98
- placeholder="Enter internal system prompt..."></textarea>
 
99
  </mat-form-field>
100
  </div>
101
  </mat-expansion-panel>
@@ -103,11 +103,11 @@
103
  <mat-expansion-panel class="settings-panel">
104
  <mat-expansion-panel-header>
105
  <mat-panel-title>
106
- <mat-icon>quiz</mat-icon>
107
  Parameter Collection Configuration
108
  </mat-panel-title>
109
  <mat-panel-description>
110
- Configure smart parameter collection behavior
111
  </mat-panel-description>
112
  </mat-expansion-panel-header>
113
 
@@ -117,54 +117,52 @@
117
  Enable Smart Parameter Collection
118
  </mat-slide-toggle>
119
 
120
- <div class="config-grid" *ngIf="parameterCollectionConfig.enabled">
121
- <div class="config-item">
122
- <label>Max Parameters per Question</label>
123
- <mat-slider min="1" max="5" step="1" discrete>
124
- <input matSliderThumb [(ngModel)]="parameterCollectionConfig.max_params_per_question"
125
- [ngModelOptions]="{standalone: true}">
126
- </mat-slider>
127
- <span class="slider-value">{{ parameterCollectionConfig.max_params_per_question }}</span>
128
- </div>
129
-
130
- <mat-slide-toggle [(ngModel)]="parameterCollectionConfig.show_all_required"
131
- [ngModelOptions]="{standalone: true}">
132
- Show All Required Parameters
133
- </mat-slide-toggle>
134
 
135
- <mat-slide-toggle [(ngModel)]="parameterCollectionConfig.ask_optional_params"
136
- [ngModelOptions]="{standalone: true}">
137
- Ask for Optional Parameters
138
- </mat-slide-toggle>
139
 
140
- <mat-slide-toggle [(ngModel)]="parameterCollectionConfig.group_related_params"
141
- [ngModelOptions]="{standalone: true}">
142
- Group Related Parameters
143
- </mat-slide-toggle>
144
 
145
- <div class="config-item">
146
- <label>Minimum Confidence Score</label>
147
- <mat-slider min="0" max="1" step="0.1" discrete>
148
- <input matSliderThumb [(ngModel)]="parameterCollectionConfig.min_confidence_score"
149
- [ngModelOptions]="{standalone: true}">
150
- </mat-slider>
151
- <span class="slider-value">{{ parameterCollectionConfig.min_confidence_score }}</span>
152
- </div>
153
 
154
- <mat-form-field appearance="outline" class="full-width">
155
- <mat-label>Collection Prompt Template</mat-label>
156
- <textarea matInput
157
- [(ngModel)]="parameterCollectionConfig.collection_prompt"
158
- [ngModelOptions]="{standalone: true}"
159
- rows="8"></textarea>
160
- <button mat-icon-button matSuffix
161
- (click)="resetCollectionPrompt()"
162
- type="button"
163
- matTooltip="Reset to default">
164
- <mat-icon>refresh</mat-icon>
165
- </button>
166
- </mat-form-field>
167
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  </div>
169
  </mat-expansion-panel>
170
  }
@@ -181,8 +179,8 @@
181
 
182
  <mat-form-field appearance="outline" class="full-width">
183
  <mat-label>Provider</mat-label>
184
- <mat-icon matPrefix>{{ getTTSProviderIcon(currentTTSProvider || {}) }}</mat-icon>
185
- <mat-select formControlName="tts_provider_name"
186
  (selectionChange)="onTTSProviderChange($event.value)">
187
  @for (provider of ttsProviders; track provider.name) {
188
  <mat-option [value]="provider.name">
@@ -191,35 +189,32 @@
191
  </mat-option>
192
  }
193
  </mat-select>
194
- @if (currentTTSProvider?.description) {
195
- <mat-hint>{{ currentTTSProvider.description }}</mat-hint>
196
  }
197
  </mat-form-field>
198
 
199
- @if (currentTTSProvider?.requires_api_key) {
200
  <mat-form-field appearance="outline" class="full-width">
201
- <mat-label>{{ getApiKeyLabel('tts') }}</mat-label>
202
  <mat-icon matPrefix>key</mat-icon>
203
  <input matInput
204
  type="password"
205
  formControlName="tts_provider_api_key"
206
  [placeholder]="getApiKeyPlaceholder('tts')">
207
  <mat-error *ngIf="form.get('tts_provider_api_key')?.hasError('required')">
208
- API key is required for {{ currentTTSProvider?.display_name }}
209
  </mat-error>
210
  </mat-form-field>
211
  }
212
 
213
- @if (currentTTSProvider?.requires_endpoint) {
214
  <mat-form-field appearance="outline" class="full-width">
215
  <mat-label>Endpoint URL</mat-label>
216
  <mat-icon matPrefix>link</mat-icon>
217
  <input matInput
218
  formControlName="tts_provider_endpoint"
219
  [placeholder]="getEndpointPlaceholder('tts')">
220
- <mat-error *ngIf="form.get('tts_provider_endpoint')?.hasError('required')">
221
- Endpoint is required for {{ currentTTSProvider?.display_name }}
222
- </mat-error>
223
  </mat-form-field>
224
  }
225
  </div>
@@ -235,8 +230,8 @@
235
 
236
  <mat-form-field appearance="outline" class="full-width">
237
  <mat-label>Provider</mat-label>
238
- <mat-icon matPrefix>{{ getSTTProviderIcon(currentSTTProvider || {}) }}</mat-icon>
239
- <mat-select formControlName="stt_provider_name"
240
  (selectionChange)="onSTTProviderChange($event.value)">
241
  @for (provider of sttProviders; track provider.name) {
242
  <mat-option [value]="provider.name">
@@ -245,50 +240,44 @@
245
  </mat-option>
246
  }
247
  </mat-select>
248
- @if (currentSTTProvider?.description) {
249
- <mat-hint>{{ currentSTTProvider.description }}</mat-hint>
250
  }
251
  </mat-form-field>
252
 
253
- @if (currentSTTProvider?.requires_api_key) {
254
  <mat-form-field appearance="outline" class="full-width">
255
  <mat-label>{{ getApiKeyLabel('stt') }}</mat-label>
256
  <mat-icon matPrefix>key</mat-icon>
257
  <input matInput
258
- [type]="currentSTTProvider.name === 'google' ? 'text' : 'password'"
259
  formControlName="stt_provider_api_key"
260
  [placeholder]="getApiKeyPlaceholder('stt')">
261
  <mat-error *ngIf="form.get('stt_provider_api_key')?.hasError('required')">
262
- {{ currentSTTProvider.name === 'google' ? 'Credentials path' : 'API key' }} is required for {{ currentSTTProvider?.display_name }}
263
  </mat-error>
264
  </mat-form-field>
265
  }
266
 
267
- @if (currentSTTProvider?.requires_endpoint) {
268
  <mat-form-field appearance="outline" class="full-width">
269
  <mat-label>Endpoint URL</mat-label>
270
  <mat-icon matPrefix>link</mat-icon>
271
  <input matInput
272
  formControlName="stt_provider_endpoint"
273
  [placeholder]="getEndpointPlaceholder('stt')">
274
- <mat-error *ngIf="form.get('stt_provider_endpoint')?.hasError('required')">
275
- Endpoint is required for {{ currentSTTProvider?.display_name }}
276
- </mat-error>
277
  </mat-form-field>
278
  }
279
  </div>
280
  </form>
281
  }
282
  </mat-card-content>
283
-
284
  <mat-card-actions align="end">
285
- <button mat-button (click)="loadEnvironment()" [disabled]="loading || saving">
286
- <mat-icon>refresh</mat-icon>
287
- Reload
288
- </button>
289
- <button mat-raised-button color="primary"
290
- (click)="save()"
291
- [disabled]="form.invalid || loading || saving">
292
  <mat-icon>save</mat-icon>
293
  {{ saving ? 'Saving...' : 'Save Configuration' }}
294
  </button>
 
23
 
24
  <mat-form-field appearance="outline" class="full-width">
25
  <mat-label>Provider</mat-label>
26
+ <mat-icon matPrefix>{{ getLLMProviderIcon(currentLLMProviderSafe) }}</mat-icon>
27
  <mat-select formControlName="llm_provider_name"
28
  (selectionChange)="onLLMProviderChange($event.value)">
29
  @for (provider of llmProviders; track provider.name) {
 
33
  </mat-option>
34
  }
35
  </mat-select>
36
+ @if (currentLLMProviderSafe?.description) {
37
+ <mat-hint>{{ currentLLMProviderSafe.description }}</mat-hint>
38
  }
39
  </mat-form-field>
40
 
41
+ @if (currentLLMProviderSafe?.requires_api_key) {
42
  <mat-form-field appearance="outline" class="full-width">
43
  <mat-label>{{ getApiKeyLabel('llm') }}</mat-label>
44
  <mat-icon matPrefix>key</mat-icon>
 
47
  formControlName="llm_provider_api_key"
48
  [placeholder]="getApiKeyPlaceholder('llm')">
49
  <mat-error *ngIf="form.get('llm_provider_api_key')?.hasError('required')">
50
+ API key is required for {{ currentLLMProviderSafe?.display_name }}
51
  </mat-error>
52
  </mat-form-field>
53
  }
54
 
55
+ @if (currentLLMProviderSafe?.requires_endpoint) {
56
  <mat-form-field appearance="outline" class="full-width">
57
  <mat-label>Endpoint URL</mat-label>
58
  <mat-icon matPrefix>link</mat-icon>
 
66
  <mat-icon>wifi_tethering</mat-icon>
67
  </button>
68
  <mat-error *ngIf="form.get('llm_provider_endpoint')?.hasError('required')">
69
+ Endpoint is required for {{ currentLLMProviderSafe?.display_name }}
70
  </mat-error>
71
  </mat-form-field>
72
  }
73
 
74
  <!-- LLM Settings (Internal Prompt & Parameter Collection) -->
75
+ @if (currentLLMProviderSafe) {
76
  <mat-expansion-panel class="settings-panel">
77
  <mat-expansion-panel-header>
78
  <mat-panel-title>
 
86
 
87
  <div class="panel-content">
88
  <p class="hint-text">
89
+ This prompt is prepended to all intent detection requests.
 
90
  </p>
91
  <mat-form-field appearance="outline" class="full-width">
92
  <mat-label>Internal Prompt</mat-label>
93
  <textarea matInput
94
  [(ngModel)]="internalPrompt"
95
  [ngModelOptions]="{standalone: true}"
96
+ rows="10"
97
+ placeholder="Enter the system prompt that guides intent detection..."></textarea>
98
+ <mat-hint>Use clear instructions to guide the LLM's behavior</mat-hint>
99
  </mat-form-field>
100
  </div>
101
  </mat-expansion-panel>
 
103
  <mat-expansion-panel class="settings-panel">
104
  <mat-expansion-panel-header>
105
  <mat-panel-title>
106
+ <mat-icon>tune</mat-icon>
107
  Parameter Collection Configuration
108
  </mat-panel-title>
109
  <mat-panel-description>
110
+ Fine-tune how parameters are collected from users
111
  </mat-panel-description>
112
  </mat-expansion-panel-header>
113
 
 
117
  Enable Smart Parameter Collection
118
  </mat-slide-toggle>
119
 
120
+ <div class="config-item">
121
+ <label>Max Parameters per Question</label>
122
+ <mat-slider min="1" max="5" step="1" discrete>
123
+ <input matSliderThumb [(ngModel)]="parameterCollectionConfig.max_params_per_question"
124
+ [ngModelOptions]="{standalone: true}">
125
+ </mat-slider>
126
+ <span class="slider-value">{{ parameterCollectionConfig.max_params_per_question }}</span>
127
+ </div>
 
 
 
 
 
 
128
 
129
+ <mat-slide-toggle [(ngModel)]="parameterCollectionConfig.show_all_required"
130
+ [ngModelOptions]="{standalone: true}">
131
+ Show All Required Parameters
132
+ </mat-slide-toggle>
133
 
134
+ <mat-slide-toggle [(ngModel)]="parameterCollectionConfig.ask_optional_params"
135
+ [ngModelOptions]="{standalone: true}">
136
+ Ask for Optional Parameters
137
+ </mat-slide-toggle>
138
 
139
+ <mat-slide-toggle [(ngModel)]="parameterCollectionConfig.group_related_params"
140
+ [ngModelOptions]="{standalone: true}">
141
+ Group Related Parameters
142
+ </mat-slide-toggle>
 
 
 
 
143
 
144
+ <div class="config-item">
145
+ <label>Minimum Confidence Score</label>
146
+ <mat-slider min="0" max="1" step="0.1" discrete>
147
+ <input matSliderThumb [(ngModel)]="parameterCollectionConfig.min_confidence_score"
148
+ [ngModelOptions]="{standalone: true}">
149
+ </mat-slider>
150
+ <span class="slider-value">{{ parameterCollectionConfig.min_confidence_score }}</span>
 
 
 
 
 
 
151
  </div>
152
+
153
+ <mat-form-field appearance="outline" class="full-width">
154
+ <mat-label>Collection Prompt Template</mat-label>
155
+ <textarea matInput
156
+ [(ngModel)]="parameterCollectionConfig.collection_prompt"
157
+ [ngModelOptions]="{standalone: true}"
158
+ rows="8"></textarea>
159
+ <button mat-icon-button matSuffix
160
+ (click)="resetCollectionPrompt()"
161
+ type="button"
162
+ matTooltip="Reset to default">
163
+ <mat-icon>refresh</mat-icon>
164
+ </button>
165
+ </mat-form-field>
166
  </div>
167
  </mat-expansion-panel>
168
  }
 
179
 
180
  <mat-form-field appearance="outline" class="full-width">
181
  <mat-label>Provider</mat-label>
182
+ <mat-icon matPrefix>{{ getTTSProviderIcon(currentTTSProviderSafe) }}</mat-icon>
183
+ <mat-select formControlName="tts_provider_name"
184
  (selectionChange)="onTTSProviderChange($event.value)">
185
  @for (provider of ttsProviders; track provider.name) {
186
  <mat-option [value]="provider.name">
 
189
  </mat-option>
190
  }
191
  </mat-select>
192
+ @if (currentTTSProviderSafe?.description) {
193
+ <mat-hint>{{ currentTTSProviderSafe.description }}</mat-hint>
194
  }
195
  </mat-form-field>
196
 
197
+ @if (currentTTSProviderSafe?.requires_api_key) {
198
  <mat-form-field appearance="outline" class="full-width">
199
+ <mat-label>API Key</mat-label>
200
  <mat-icon matPrefix>key</mat-icon>
201
  <input matInput
202
  type="password"
203
  formControlName="tts_provider_api_key"
204
  [placeholder]="getApiKeyPlaceholder('tts')">
205
  <mat-error *ngIf="form.get('tts_provider_api_key')?.hasError('required')">
206
+ API key is required for {{ currentTTSProviderSafe?.display_name }}
207
  </mat-error>
208
  </mat-form-field>
209
  }
210
 
211
+ @if (currentTTSProviderSafe?.requires_endpoint) {
212
  <mat-form-field appearance="outline" class="full-width">
213
  <mat-label>Endpoint URL</mat-label>
214
  <mat-icon matPrefix>link</mat-icon>
215
  <input matInput
216
  formControlName="tts_provider_endpoint"
217
  [placeholder]="getEndpointPlaceholder('tts')">
 
 
 
218
  </mat-form-field>
219
  }
220
  </div>
 
230
 
231
  <mat-form-field appearance="outline" class="full-width">
232
  <mat-label>Provider</mat-label>
233
+ <mat-icon matPrefix>{{ getSTTProviderIcon(currentSTTProviderSafe) }}</mat-icon>
234
+ <mat-select formControlName="stt_provider_name"
235
  (selectionChange)="onSTTProviderChange($event.value)">
236
  @for (provider of sttProviders; track provider.name) {
237
  <mat-option [value]="provider.name">
 
240
  </mat-option>
241
  }
242
  </mat-select>
243
+ @if (currentSTTProviderSafe?.description) {
244
+ <mat-hint>{{ currentSTTProviderSafe.description }}</mat-hint>
245
  }
246
  </mat-form-field>
247
 
248
+ @if (currentSTTProviderSafe?.requires_api_key) {
249
  <mat-form-field appearance="outline" class="full-width">
250
  <mat-label>{{ getApiKeyLabel('stt') }}</mat-label>
251
  <mat-icon matPrefix>key</mat-icon>
252
  <input matInput
253
+ [type]="currentSTTProviderSafe?.name === 'google' ? 'text' : 'password'"
254
  formControlName="stt_provider_api_key"
255
  [placeholder]="getApiKeyPlaceholder('stt')">
256
  <mat-error *ngIf="form.get('stt_provider_api_key')?.hasError('required')">
257
+ {{ currentSTTProviderSafe?.name === 'google' ? 'Credentials path' : 'API key' }} is required for {{ currentSTTProviderSafe?.display_name }}
258
  </mat-error>
259
  </mat-form-field>
260
  }
261
 
262
+ @if (currentSTTProviderSafe?.requires_endpoint) {
263
  <mat-form-field appearance="outline" class="full-width">
264
  <mat-label>Endpoint URL</mat-label>
265
  <mat-icon matPrefix>link</mat-icon>
266
  <input matInput
267
  formControlName="stt_provider_endpoint"
268
  [placeholder]="getEndpointPlaceholder('stt')">
 
 
 
269
  </mat-form-field>
270
  }
271
  </div>
272
  </form>
273
  }
274
  </mat-card-content>
275
+
276
  <mat-card-actions align="end">
277
+ <button mat-raised-button
278
+ color="primary"
279
+ (click)="saveEnvironment()"
280
+ [disabled]="form.invalid || saving">
 
 
 
281
  <mat-icon>save</mat-icon>
282
  {{ saving ? 'Saving...' : 'Save Configuration' }}
283
  </button>