|
69 | 69 | <MudTextSwitch Label="AI-based data validation" Value="@this.aiBasedValidation" LabelOn="Yes, let the AI validate & filter the retrieved data." LabelOff="No, use all data retrieved from the data sources." ValueChanged="@this.ValidationModeChanged"/> |
70 | 70 | } |
71 | 71 |
|
72 | | - @if (this.aiBasedSourceSelection is false || this.DataSourcesAISelected.Count == 0) |
| 72 | + @switch (this.aiBasedSourceSelection) |
73 | 73 | { |
74 | | - <MudField Label="Available Data Sources" Variant="Variant.Outlined" Class="mb-3" Disabled="@this.aiBasedSourceSelection"> |
75 | | - <MudList T="IDataSource" SelectionMode="@this.GetListSelectionMode()" @bind-SelectedValues:get="@this.selectedDataSources" @bind-SelectedValues:set="@(x => this.SelectionChanged(x))" Style="max-height: 14em;"> |
76 | | - @foreach (var source in this.availableDataSources) |
77 | | - { |
78 | | - <MudListItem Value="@source"> |
79 | | - @source.Name |
80 | | - </MudListItem> |
81 | | - } |
82 | | - </MudList> |
83 | | - </MudField> |
84 | | - } |
85 | | - else |
86 | | - { |
87 | | - <MudExpansionPanels MultiExpansion="@false" Class="mt-3" Style="max-height: 14em;"> |
88 | | - <ExpansionPanel HeaderIcon="@Icons.Material.Filled.TouchApp" HeaderText="Available Data Sources"> |
89 | | - <MudList T="IDataSource" SelectionMode="MudBlazor.SelectionMode.SingleSelection" SelectedValues="@this.selectedDataSources" Style="max-height: 14em;"> |
| 74 | + case true when this.availableDataSources.Count == 0: |
| 75 | + <MudText Typo="Typo.body1" Class="mb-3"> |
| 76 | + Your data sources cannot be used with the LLM provider you selected due to data privacy, or they are currently unavailable. |
| 77 | + </MudText> |
| 78 | + break; |
| 79 | + |
| 80 | + case true when this.DataSourcesAISelected.Count == 0: |
| 81 | + <MudText Typo="Typo.body1" Class="mb-3"> |
| 82 | + The AI evaluates each of your inputs to determine whether and which data sources are necessary. Currently, the AI has not selected any source. |
| 83 | + </MudText> |
| 84 | + break; |
| 85 | + |
| 86 | + case false when this.availableDataSources.Count == 0: |
| 87 | + <MudText Typo="Typo.body1" Class="mb-3"> |
| 88 | + Your data sources cannot be used with the LLM provider you selected due to data privacy, or they are currently unavailable. |
| 89 | + </MudText> |
| 90 | + break; |
| 91 | + |
| 92 | + case false: |
| 93 | + <MudField Label="Available Data Sources" Variant="Variant.Outlined" Class="mb-3" Disabled="@this.aiBasedSourceSelection"> |
| 94 | + <MudList T="IDataSource" SelectionMode="@this.GetListSelectionMode()" @bind-SelectedValues:get="@this.selectedDataSources" @bind-SelectedValues:set="@(x => this.SelectionChanged(x))" Style="max-height: 14em;"> |
90 | 95 | @foreach (var source in this.availableDataSources) |
91 | 96 | { |
92 | 97 | <MudListItem Value="@source"> |
93 | 98 | @source.Name |
94 | 99 | </MudListItem> |
95 | 100 | } |
96 | 101 | </MudList> |
97 | | - </ExpansionPanel> |
98 | | - <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Filter" HeaderText="AI-Selected Data Sources"> |
99 | | - <MudList T="DataSourceAgentSelected" SelectionMode="MudBlazor.SelectionMode.MultiSelection" ReadOnly="@true" SelectedValues="@this.GetSelectedDataSourcesWithAI()" Style="max-height: 14em;"> |
100 | | - @foreach (var source in this.DataSourcesAISelected) |
101 | | - { |
102 | | - <MudListItem Value="@source"> |
103 | | - <ChildContent> |
104 | | - <MudText Typo="Typo.body1"> |
105 | | - @source.DataSource.Name |
106 | | - </MudText> |
| 102 | + </MudField> |
| 103 | + break; |
| 104 | + |
| 105 | + case true: |
| 106 | + <MudExpansionPanels MultiExpansion="@false" Class="mt-3" Style="max-height: 14em;"> |
| 107 | + <ExpansionPanel HeaderIcon="@Icons.Material.Filled.TouchApp" HeaderText="Available Data Sources"> |
| 108 | + <MudList T="IDataSource" SelectionMode="MudBlazor.SelectionMode.SingleSelection" SelectedValues="@this.selectedDataSources" Style="max-height: 14em;"> |
| 109 | + @foreach (var source in this.availableDataSources) |
| 110 | + { |
| 111 | + <MudListItem Value="@source"> |
| 112 | + @source.Name |
| 113 | + </MudListItem> |
| 114 | + } |
| 115 | + </MudList> |
| 116 | + </ExpansionPanel> |
| 117 | + <ExpansionPanel HeaderIcon="@Icons.Material.Filled.Filter" HeaderText="AI-Selected Data Sources"> |
| 118 | + <MudList T="DataSourceAgentSelected" SelectionMode="MudBlazor.SelectionMode.MultiSelection" ReadOnly="@true" SelectedValues="@this.GetSelectedDataSourcesWithAI()" Style="max-height: 14em;"> |
| 119 | + @foreach (var source in this.DataSourcesAISelected) |
| 120 | + { |
| 121 | + <MudListItem Value="@source"> |
| 122 | + <ChildContent> |
| 123 | + <MudText Typo="Typo.body1"> |
| 124 | + @source.DataSource.Name |
| 125 | + </MudText> |
107 | 126 |
|
108 | | - <MudProgressLinear Color="Color.Info" Min="0" Max="1" Value="@source.AIDecision.Confidence"/> |
109 | | - <MudJustifiedText Typo="Typo.body2"> |
110 | | - @this.GetAIReasoning(source) |
111 | | - </MudJustifiedText> |
112 | | - </ChildContent> |
113 | | - </MudListItem> |
114 | | - } |
115 | | - </MudList> |
116 | | - </ExpansionPanel> |
117 | | - </MudExpansionPanels> |
| 127 | + <MudProgressLinear Color="Color.Info" Min="0" Max="1" Value="@source.AIDecision.Confidence"/> |
| 128 | + <MudJustifiedText Typo="Typo.body2"> |
| 129 | + @(this.GetAIReasoning(source)) |
| 130 | + </MudJustifiedText> |
| 131 | + </ChildContent> |
| 132 | + </MudListItem> |
| 133 | + } |
| 134 | + </MudList> |
| 135 | + </ExpansionPanel> |
| 136 | + </MudExpansionPanels> |
| 137 | + break; |
118 | 138 | } |
119 | 139 | } |
120 | 140 | } |
|
0 commit comments