Skip to content

Commit 0d6289d

Browse files
authored
documentsRequired handling (#1815)
1 parent f91bff6 commit 0d6289d

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

bot/admin/web/src/app/rag/rag-settings/models/rag-settings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ export interface RagSettings {
1414

1515
indexSessionId: string;
1616
indexName: string;
17+
18+
documentsRequired: boolean;
1719
}

bot/admin/web/src/app/rag/rag-settings/rag-settings.component.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,20 @@ <h5 class="section-title mt-2">Indexing session</h5>
209209
/>
210210
</tock-form-control>
211211

212+
<tock-form-control
213+
label="Documents required"
214+
name="documentsRequired"
215+
[controls]="documentsRequired"
216+
[required]="false"
217+
[boldLabel]="false"
218+
information="Allowing the LLM to answer even if no documents have been found allows to make small talk and answer more general questions."
219+
>
220+
<nb-checkbox formControlName="documentsRequired">
221+
<span *ngIf="documentsRequired.value">Don't allow undocumented answers.</span>
222+
<span *ngIf="!documentsRequired.value">Allow undocumented answers.</span>
223+
</nb-checkbox>
224+
</tock-form-control>
225+
212226
<h5 class="section-title mt-2">Conversation flow</h5>
213227

214228
<tock-form-control

bot/admin/web/src/app/rag/rag-settings/rag-settings.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ interface RagSettingsForm {
3232
indexSessionId: FormControl<string>;
3333
indexName: FormControl<string>;
3434

35+
documentsRequired: FormControl<boolean>;
36+
3537
llmEngine: FormControl<AiEngineProvider>;
3638
llmSetting: FormGroup<any>;
3739
emEngine: FormControl<AiEngineProvider>;
@@ -138,6 +140,7 @@ export class RagSettingsComponent implements OnInit, OnDestroy {
138140
noAnswerStoryId: new FormControl(undefined),
139141
indexSessionId: new FormControl(undefined),
140142
indexName: new FormControl(undefined),
143+
documentsRequired: new FormControl(undefined),
141144
llmEngine: new FormControl(undefined, [Validators.required]),
142145
llmSetting: new FormGroup<any>({}),
143146
emEngine: new FormControl(undefined, [Validators.required]),
@@ -165,6 +168,10 @@ export class RagSettingsComponent implements OnInit, OnDestroy {
165168
return this.form.get('indexSessionId') as FormControl;
166169
}
167170

171+
get documentsRequired(): FormControl {
172+
return this.form.get('documentsRequired') as FormControl;
173+
}
174+
168175
get indexName(): FormControl {
169176
return this.form.get('indexName') as FormControl;
170177
}

0 commit comments

Comments
 (0)