Spaces:
Building
Building
Update flare-ui/src/app/components/environment/environment.component.html
Browse files
flare-ui/src/app/components/environment/environment.component.html
CHANGED
@@ -160,129 +160,6 @@
|
|
160 |
</mat-form-field>
|
161 |
</div>
|
162 |
|
163 |
-
<!-- Parameter Collection Configuration -->
|
164 |
-
<mat-expansion-panel class="config-panel">
|
165 |
-
<mat-expansion-panel-header>
|
166 |
-
<mat-panel-title>
|
167 |
-
<mat-icon>psychology</mat-icon>
|
168 |
-
Parameter Collection Configuration
|
169 |
-
</mat-panel-title>
|
170 |
-
<mat-panel-description>
|
171 |
-
Configure smart parameter collection behavior
|
172 |
-
</mat-panel-description>
|
173 |
-
</mat-expansion-panel-header>
|
174 |
-
|
175 |
-
<div class="panel-content">
|
176 |
-
<div class="config-grid">
|
177 |
-
<!-- Max Parameters Per Question -->
|
178 |
-
<div class="config-field">
|
179 |
-
<label>Max Parameters Per Question</label>
|
180 |
-
<mat-slider
|
181 |
-
min="1"
|
182 |
-
max="5"
|
183 |
-
step="1"
|
184 |
-
discrete
|
185 |
-
[displayWith]="formatSliderLabel"
|
186 |
-
[(ngModel)]="envForm.parameter_collection_config.max_params_per_question"
|
187 |
-
class="full-width">
|
188 |
-
<input matSliderThumb>
|
189 |
-
</mat-slider>
|
190 |
-
<span class="slider-value">{{ envForm.parameter_collection_config.max_params_per_question }}</span>
|
191 |
-
</div>
|
192 |
-
|
193 |
-
<!-- Smart Grouping -->
|
194 |
-
<div class="config-field">
|
195 |
-
<mat-slide-toggle
|
196 |
-
[(ngModel)]="envForm.parameter_collection_config.smart_grouping"
|
197 |
-
color="primary">
|
198 |
-
Smart Grouping
|
199 |
-
</mat-slide-toggle>
|
200 |
-
<mat-hint>Automatically group related parameters</mat-hint>
|
201 |
-
</div>
|
202 |
-
|
203 |
-
<!-- Retry Unanswered -->
|
204 |
-
<div class="config-field">
|
205 |
-
<mat-slide-toggle
|
206 |
-
[(ngModel)]="envForm.parameter_collection_config.retry_unanswered"
|
207 |
-
color="primary">
|
208 |
-
Retry Unanswered Parameters
|
209 |
-
</mat-slide-toggle>
|
210 |
-
<mat-hint>Re-ask parameters that weren't answered</mat-hint>
|
211 |
-
</div>
|
212 |
-
</div>
|
213 |
-
|
214 |
-
<!-- Collection Prompt Template -->
|
215 |
-
<div class="prompt-section">
|
216 |
-
<h3>Collection Prompt Template</h3>
|
217 |
-
<mat-form-field appearance="outline" class="full-width">
|
218 |
-
<mat-label>Prompt Template</mat-label>
|
219 |
-
<textarea
|
220 |
-
matInput
|
221 |
-
[(ngModel)]="envForm.parameter_collection_config.collection_prompt"
|
222 |
-
rows="12"
|
223 |
-
placeholder="Enter the prompt template for generating parameter questions..."
|
224 |
-
class="code-textarea">
|
225 |
-
</textarea>
|
226 |
-
<mat-hint>
|
227 |
-
Available variables: {{conversation_history}}, {{intent_name}}, {{intent_caption}},
|
228 |
-
{{collected_params}}, {{missing_params}}, {{unanswered_params}}, {{max_params}}, {{project_language}}
|
229 |
-
</mat-hint>
|
230 |
-
</mat-form-field>
|
231 |
-
|
232 |
-
<!-- Template Variables Help -->
|
233 |
-
<mat-expansion-panel class="help-panel">
|
234 |
-
<mat-expansion-panel-header>
|
235 |
-
<mat-panel-title>
|
236 |
-
<mat-icon>help_outline</mat-icon>
|
237 |
-
Template Variables Reference
|
238 |
-
</mat-panel-title>
|
239 |
-
</mat-expansion-panel-header>
|
240 |
-
|
241 |
-
<mat-list>
|
242 |
-
<mat-list-item>
|
243 |
-
<code class="variable">{{conversation_history}}</code>
|
244 |
-
<span class="description">Recent conversation between user and assistant</span>
|
245 |
-
</mat-list-item>
|
246 |
-
<mat-list-item>
|
247 |
-
<code class="variable">{{intent_name}}</code>
|
248 |
-
<span class="description">Technical name of the detected intent</span>
|
249 |
-
</mat-list-item>
|
250 |
-
<mat-list-item>
|
251 |
-
<code class="variable">{{intent_caption}}</code>
|
252 |
-
<span class="description">Human-readable caption of the intent</span>
|
253 |
-
</mat-list-item>
|
254 |
-
<mat-list-item>
|
255 |
-
<code class="variable">{{collected_params}}</code>
|
256 |
-
<span class="description">Parameters already collected with their values</span>
|
257 |
-
</mat-list-item>
|
258 |
-
<mat-list-item>
|
259 |
-
<code class="variable">{{missing_params}}</code>
|
260 |
-
<span class="description">Parameters still needed to complete the request</span>
|
261 |
-
</mat-list-item>
|
262 |
-
<mat-list-item>
|
263 |
-
<code class="variable">{{unanswered_params}}</code>
|
264 |
-
<span class="description">Parameters asked before but not answered by user</span>
|
265 |
-
</mat-list-item>
|
266 |
-
<mat-list-item>
|
267 |
-
<code class="variable">{{max_params}}</code>
|
268 |
-
<span class="description">Maximum number of parameters to ask in one question</span>
|
269 |
-
</mat-list-item>
|
270 |
-
<mat-list-item>
|
271 |
-
<code class="variable">{{project_language}}</code>
|
272 |
-
<span class="description">Language setting of the current project</span>
|
273 |
-
</mat-list-item>
|
274 |
-
</mat-list>
|
275 |
-
</mat-expansion-panel>
|
276 |
-
|
277 |
-
<!-- Reset to Default Button -->
|
278 |
-
<button mat-button color="accent" (click)="resetCollectionPrompt()">
|
279 |
-
<mat-icon>restore</mat-icon>
|
280 |
-
Reset to Default Template
|
281 |
-
</button>
|
282 |
-
</div>
|
283 |
-
</div>
|
284 |
-
</mat-expansion-panel>
|
285 |
-
|
286 |
<div>
|
287 |
<!-- STT Settings Panel -->
|
288 |
<mat-expansion-panel class="stt-settings-panel" *ngIf="environment.stt_engine !== 'no_stt'">
|
@@ -434,6 +311,136 @@
|
|
434 |
</mat-form-field>
|
435 |
</mat-expansion-panel>
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
<div class="form-actions">
|
438 |
<button
|
439 |
mat-raised-button
|
|
|
160 |
</mat-form-field>
|
161 |
</div>
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
<div>
|
164 |
<!-- STT Settings Panel -->
|
165 |
<mat-expansion-panel class="stt-settings-panel" *ngIf="environment.stt_engine !== 'no_stt'">
|
|
|
311 |
</mat-form-field>
|
312 |
</mat-expansion-panel>
|
313 |
|
314 |
+
<!-- Parameter Collection Configuration -->
|
315 |
+
<mat-expansion-panel class="prompt-panel">
|
316 |
+
<mat-expansion-panel-header>
|
317 |
+
<mat-panel-title>
|
318 |
+
<mat-icon>psychology</mat-icon>
|
319 |
+
Parameter Collection Configuration
|
320 |
+
</mat-panel-title>
|
321 |
+
<mat-panel-description>
|
322 |
+
Configure smart parameter collection behavior
|
323 |
+
</mat-panel-description>
|
324 |
+
</mat-expansion-panel-header>
|
325 |
+
|
326 |
+
<div class="param-collection-content">
|
327 |
+
<div class="config-grid">
|
328 |
+
<!-- Max Parameters Per Question -->
|
329 |
+
<div class="slider-field">
|
330 |
+
<label>Max Parameters Per Question: {{ parameterCollectionConfig.max_params_per_question }}</label>
|
331 |
+
<mat-slider
|
332 |
+
[min]="1"
|
333 |
+
[max]="5"
|
334 |
+
[step]="1"
|
335 |
+
[discrete]="true"
|
336 |
+
>
|
337 |
+
<input matSliderThumb
|
338 |
+
name="maxParamsPerQuestion"
|
339 |
+
[(ngModel)]="parameterCollectionConfig.max_params_per_question">
|
340 |
+
</mat-slider>
|
341 |
+
<mat-hint>Maximum number of parameters to ask in one question</mat-hint>
|
342 |
+
</div>
|
343 |
+
|
344 |
+
<!-- Smart Grouping -->
|
345 |
+
<mat-checkbox
|
346 |
+
name="smartGrouping"
|
347 |
+
[(ngModel)]="parameterCollectionConfig.smart_grouping"
|
348 |
+
[disabled]="loading"
|
349 |
+
class="collection-checkbox">
|
350 |
+
Smart Grouping
|
351 |
+
<mat-hint>Automatically group related parameters (e.g., from/to cities)</mat-hint>
|
352 |
+
</mat-checkbox>
|
353 |
+
|
354 |
+
<!-- Retry Unanswered -->
|
355 |
+
<mat-checkbox
|
356 |
+
name="retryUnanswered"
|
357 |
+
[(ngModel)]="parameterCollectionConfig.retry_unanswered"
|
358 |
+
[disabled]="loading"
|
359 |
+
class="collection-checkbox">
|
360 |
+
Retry Unanswered Parameters
|
361 |
+
<mat-hint>Re-ask parameters that the user didn't answer</mat-hint>
|
362 |
+
</mat-checkbox>
|
363 |
+
</div>
|
364 |
+
|
365 |
+
<!-- Collection Prompt Template -->
|
366 |
+
<mat-form-field appearance="outline" class="full-width">
|
367 |
+
<mat-label>Collection Prompt Template</mat-label>
|
368 |
+
<textarea
|
369 |
+
matInput
|
370 |
+
name="collectionPrompt"
|
371 |
+
[(ngModel)]="parameterCollectionConfig.collection_prompt"
|
372 |
+
[disabled]="loading"
|
373 |
+
rows="12"
|
374 |
+
placeholder="Enter the prompt template for generating parameter questions..."
|
375 |
+
class="code-textarea"
|
376 |
+
></textarea>
|
377 |
+
<mat-hint>
|
378 |
+
Available variables: {{conversation_history}}, {{intent_name}}, {{intent_caption}},
|
379 |
+
{{collected_params}}, {{missing_params}}, {{unanswered_params}}, {{max_params}}, {{project_language}}
|
380 |
+
</mat-hint>
|
381 |
+
</mat-form-field>
|
382 |
+
|
383 |
+
<!-- Template Variables Help -->
|
384 |
+
<mat-expansion-panel class="help-panel">
|
385 |
+
<mat-expansion-panel-header>
|
386 |
+
<mat-panel-title>
|
387 |
+
<mat-icon>help_outline</mat-icon>
|
388 |
+
Template Variables Reference
|
389 |
+
</mat-panel-title>
|
390 |
+
</mat-expansion-panel-header>
|
391 |
+
|
392 |
+
<mat-list>
|
393 |
+
<mat-list-item>
|
394 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
395 |
+
<div matListItemTitle><code>{{conversation_history}}</code></div>
|
396 |
+
<div matListItemLine>Recent conversation between user and assistant</div>
|
397 |
+
</mat-list-item>
|
398 |
+
<mat-list-item>
|
399 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
400 |
+
<div matListItemTitle><code>{{intent_name}}</code></div>
|
401 |
+
<div matListItemLine>Technical name of the detected intent</div>
|
402 |
+
</mat-list-item>
|
403 |
+
<mat-list-item>
|
404 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
405 |
+
<div matListItemTitle><code>{{intent_caption}}</code></div>
|
406 |
+
<div matListItemLine>Human-readable caption of the intent</div>
|
407 |
+
</mat-list-item>
|
408 |
+
<mat-list-item>
|
409 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
410 |
+
<div matListItemTitle><code>{{collected_params}}</code></div>
|
411 |
+
<div matListItemLine>Parameters already collected with their values</div>
|
412 |
+
</mat-list-item>
|
413 |
+
<mat-list-item>
|
414 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
415 |
+
<div matListItemTitle><code>{{missing_params}}</code></div>
|
416 |
+
<div matListItemLine>Parameters still needed to complete the request</div>
|
417 |
+
</mat-list-item>
|
418 |
+
<mat-list-item>
|
419 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
420 |
+
<div matListItemTitle><code>{{unanswered_params}}</code></div>
|
421 |
+
<div matListItemLine>Parameters asked before but not answered by user</div>
|
422 |
+
</mat-list-item>
|
423 |
+
<mat-list-item>
|
424 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
425 |
+
<div matListItemTitle><code>{{max_params}}</code></div>
|
426 |
+
<div matListItemLine>Maximum number of parameters to ask in one question</div>
|
427 |
+
</mat-list-item>
|
428 |
+
<mat-list-item>
|
429 |
+
<mat-icon matListItemIcon>code</mat-icon>
|
430 |
+
<div matListItemTitle><code>{{project_language}}</code></div>
|
431 |
+
<div matListItemLine>Language setting of the current project</div>
|
432 |
+
</mat-list-item>
|
433 |
+
</mat-list>
|
434 |
+
</mat-expansion-panel>
|
435 |
+
|
436 |
+
<!-- Reset to Default Button -->
|
437 |
+
<button mat-stroked-button type="button" (click)="resetCollectionPrompt()" [disabled]="loading">
|
438 |
+
<mat-icon>restore</mat-icon>
|
439 |
+
Reset to Default Template
|
440 |
+
</button>
|
441 |
+
</div>
|
442 |
+
</mat-expansion-panel>
|
443 |
+
|
444 |
<div class="form-actions">
|
445 |
<button
|
446 |
mat-raised-button
|