@using AIStudio.Settings
@using AIStudio.Provider
@inherits MSGComponentBase
@if (this.SelectionMode is DataSourceSelectionMode.SELECTION_MODE)
{
@if (this.PopoverTriggerMode is PopoverTriggerMode.ICON)
{
}
else
{
@T("Select data")
}
@T("Data Source Selection")
@if (this.waitingForDataSources)
{
}
else if (this.SettingsManager.ConfigurationData.DataSources.Count == 0)
{
@T("You haven't configured any data sources. To grant the AI access to your data, you need to add such a source. However, if you wish to use data from your device, you first have to set up a so-called embedding. This embedding is necessary so the AI can effectively search your data, find and retrieve the correct information required for each task. In addition to local data, you can also incorporate your company's data. To do so, your company must provide the data through an ERI (External Retrieval Interface).")
@T("Manage Data Sources")
@T("Read more about ERI")
}
else if (this.showDataSourceSelection)
{
@if (this.areDataSourcesEnabled)
{
@* Where Semantic Search cannot be used, there is no choice to make, only the reason to tell: *@
@if (this.IsSemanticSearchUnavailable)
{
@this.GetSemanticSearchUnavailableMessage()
}
else
{
}
@* With Semantic Search, no agent takes part: nothing would validate the retrieved data. *@
@if (this.SettingsManager.ConfigurationData.AgentRetrievalContextValidation.EnableRetrievalContextValidation && !this.IsSemanticSearchEffective)
{
}
@switch (this.aiBasedSourceSelection)
{
case true when this.GetListedDataSources().Count == 0:
@T("Your data sources cannot be used with the selected providers due to data privacy or confidence-level requirements, or they are currently unavailable.")
break;
case false when this.GetListedDataSources().Count == 0:
@T("Your data sources cannot be used with the selected providers due to data privacy or confidence-level requirements, or they are currently unavailable.")
break;
case false:
@foreach (var source in this.GetListedDataSources())
{
}
break;
case true:
@if (this.IsSemanticSearchEffective)
{
@T("Whenever a question calls for it, the AI picks the fitting ones among these data sources itself.")
}
else if (this.DataSourcesAISelected.Count == 0)
{
@T("The AI evaluates each of your inputs to determine whether and which data sources are necessary. Currently, the AI has not selected any source.")
}
@foreach (var source in this.GetListedDataSources())
{
}
@*
With Semantic Search, no agent selects: the chat model picks with each search, and its
searches show in the answer. With classic RAG, there is something to show once the agent
picked for a message.
*@
@if (!this.IsSemanticSearchEffective && this.DataSourcesAISelected.Count > 0)
{
@foreach (var source in this.DataSourcesAISelected)
{
@source.DataSource.Name
@if (source.DataSource is IInternalDataSource internalSource)
{
}
@(this.GetAIReasoning(source))
}
}
break;
}
@if (!this.aiBasedSourceSelection && this.GetUnavailablePreselectedDataSourcesToList().Count > 0)
{
@T("These data sources are preselected, but cannot be used right now, either due to data privacy or confidence-level requirements, or because they are unavailable:")
@foreach (var source in this.GetUnavailablePreselectedDataSourcesToList())
{
- @source.Name
}
}
}
}
@T("Close")
}
else if (this.SelectionMode is DataSourceSelectionMode.CONFIGURATION_MODE)
{
@T("Data Source Selection")
@if (!string.IsNullOrWhiteSpace(this.ConfigurationHeaderMessage))
{
@this.ConfigurationHeaderMessage
}
@if (this.areDataSourcesEnabled)
{
@* No provider is known here, so this says in general what the chat itself tells about its model: *@
@if (this.IsSemanticSearchPreferred)
{
@T("When the model of a chat cannot use tools, AI Studio uses classic RAG instead and searches your data sources with every message.")
}
@* Semantic Search may fall back to searching with every message, so the validation is kept, marked as belonging to that way only: *@
@T("Only used with classic RAG, which searches your data sources with every message:")
this.SelectionChanged(x))" ReadOnly="@(this.ReadOnly || this.IsPreselectedDataSourceIdsLocked())">
@*
The configuration mode lists what was configured, without filtering it, so no
row here is ever waiting for an index.
*@
@foreach (var source in this.availableDataSources)
{
}
}
}