mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-29 15:43:36 +00:00
Resolved 29 conflicting files. The notable decisions: Confidence: main's tool-calling gate (RequiredProviderConfidence) and this branch's local-RAG gate (DataConfidenceLevel) turned out to be the same rule on the same axis, so they are now one field. Both tool results and data sources raise it through RequireProviderConfidence(). The gate checks the level strictly and no longer exempts providers trusted by configuration: TrustedProviderIds is documented as applying to data-source security checks only, and organizations set confidence through DataConfidence .CustomConfidenceScheme instead. The security axis (DataSecurity, ERI, IsTrustedForDataSourceSecurityChecks) is unchanged. Provider creation: main's CreateProvider signature won (hfEndpointKind, capabilityOverrides, no model parameter); tokenizerPath was added to it and is set for every provider, including the new Hetzner, IONOS and LiteLLM. Provider and EmbeddingProvider combine the record parameters, Lua parsing and Lua serialization of both sides. File types: main's hierarchy (ODT leaf, WORD parent, PowerPoint without the legacy .ppt, TABULAR instead of DELIMITED_TABLE) plus this branch's SPREADSHEET parent with ODS and the xlsm/xlsb/xla/xlam extensions, which the runtime already reads. Both sides had added a conflicting HTML filter; the reading family keeps the name, and the export path uses a narrow HTML_DOCUMENT, following the existing LATEX/TEX split. Runtime: main's file_data.rs is the base, including the prompt-injection sanitizer and the extraction routes. Token counting and chunk segmentation moved into take_released, so they act on the text the filter has released rather than on text it is still holding. A failed count is logged and left out instead of ending the extraction, because the app counts such a segment itself. Data sources: the participating-provider checks of this branch are kept, and main's GetAllowedDataSources overload now builds on them. DirectChatService resolves the launched chat's data source options before the check, so filter and chat see the same options. .NET and Rust both build clean; I18N regenerated to 4060 keys.
124 lines
7.0 KiB
Plaintext
124 lines
7.0 KiB
Plaintext
@using AIStudio.Settings
|
|
@using AIStudio.Settings.DataModel
|
|
@inherits SettingsDialogBase
|
|
|
|
<MudDialog>
|
|
<TitleContent>
|
|
<PreviewPrototype/>
|
|
<MudText Typo="Typo.h6" Class="d-flex align-center">
|
|
<MudIcon Icon="@Icons.Material.Filled.IntegrationInstructions" Class="mr-2"/>
|
|
@T("Configured Data Sources")
|
|
</MudText>
|
|
</TitleContent>
|
|
<DialogContent>
|
|
<MudJustifiedText Typo="Typo.body1" Class="mb-3">
|
|
@T("You might configure different data sources. A data source can include one file, all files in a directory, or data from your company. Later, you can incorporate these data sources as needed when the AI requires this data to complete a certain task.")
|
|
</MudJustifiedText>
|
|
|
|
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Class="mb-3" Wrap="Wrap.Wrap">
|
|
<MudTextSwitch Label="@T("Automatic local data source refresh")" Value="@this.SettingsManager.ConfigurationData.App.DataSourceIndexing.AutomaticRefresh" LabelOn="@T("Local data sources refresh when files change.")" LabelOff="@T("Local data sources refresh only when triggered manually.")" ValueChanged="@this.AutomaticRefreshChanged"/>
|
|
<MudTooltip Text="@T("Refresh all")">
|
|
<MudIconButton Color="Color.Primary" Icon="@Icons.Material.Filled.Sync" Disabled="@(!this.HasRefreshableDataSources())" OnClick="@this.RefreshAllDataSources"/>
|
|
</MudTooltip>
|
|
</MudStack>
|
|
|
|
@{ var embeddingStatuses = this.DataSourceEmbeddingService.GetStatuses().ToDictionary(status => status.DataSourceId, StringComparer.OrdinalIgnoreCase); }
|
|
<MudTable Items="@this.SettingsManager.ConfigurationData.DataSources" Hover="@true" Class="border-dashed border rounded-lg">
|
|
<ColGroup>
|
|
<col style="width: 3em;"/>
|
|
<col/>
|
|
<col style="width: 9em;"/>
|
|
<col style="width: 10em;"/>
|
|
<col style="width: 8em;"/>
|
|
<col style="width: 16em;"/>
|
|
</ColGroup>
|
|
<HeaderContent>
|
|
<MudTh>#</MudTh>
|
|
<MudTh>@T("Name")</MudTh>
|
|
<MudTh>@T("Type")</MudTh>
|
|
<MudTh>@T("Embedding")</MudTh>
|
|
<MudTh>@T("Indexed files")</MudTh>
|
|
<MudTh>@T("Actions")</MudTh>
|
|
</HeaderContent>
|
|
<RowTemplate>
|
|
@{ var embeddingStatus = embeddingStatuses.GetValueOrDefault(context.Id); }
|
|
<MudTd>@context.Num</MudTd>
|
|
<MudTd Style="white-space: normal; overflow-wrap: anywhere;">@context.Name</MudTd>
|
|
<MudTd Style="white-space: nowrap;">@context.Type.GetDisplayName()</MudTd>
|
|
<MudTd Style="white-space: nowrap;">@this.GetEmbeddingName(context)</MudTd>
|
|
<MudTd>
|
|
@if (context is IInternalDataSource)
|
|
{
|
|
<MudTooltip Text="@(embeddingStatus?.StateLabel ?? T("Waiting for indexing status"))">
|
|
<MudStack Row="true" AlignItems="AlignItems.Center" Spacing="1">
|
|
<MudIcon Icon="@Icons.Material.Filled.Circle" Color="@GetIndexingStatusColor(embeddingStatus)" Size="Size.Small" Style="width: 0.75rem; height: 0.75rem; flex-shrink: 0;"/>
|
|
<MudText Typo="Typo.body2">@(embeddingStatus is null ? T("Not available") : string.Format(T("{0} of {1}"), embeddingStatus.IndexedFiles, embeddingStatus.TotalFiles))</MudText>
|
|
</MudStack>
|
|
</MudTooltip>
|
|
}
|
|
else
|
|
{
|
|
<MudText Typo="Typo.body2" Color="Color.Secondary">@T("Not applicable")</MudText>
|
|
}
|
|
</MudTd>
|
|
|
|
<MudTd>
|
|
<MudStack Row="true" Class="mb-2 mt-2" Spacing="1" Wrap="Wrap.NoWrap">
|
|
<MudTooltip Text="@T("Information")">
|
|
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Outlined.Info" OnClick="() => this.ShowInformation(context)"/>
|
|
</MudTooltip>
|
|
@if (context.IsEnterpriseConfiguration)
|
|
{
|
|
<MudTooltip Text="@T("This data source is managed by your organization.")">
|
|
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Filled.Business" Disabled="true"/>
|
|
</MudTooltip>
|
|
}
|
|
else
|
|
{
|
|
<MudTooltip Text="@T("Edit")">
|
|
<MudIconButton Color="Color.Info" Icon="@Icons.Material.Filled.Edit" OnClick="() => this.EditDataSource(context)"/>
|
|
</MudTooltip>
|
|
<MudTooltip Text="@T("Refresh")">
|
|
<MudIconButton Color="Color.Primary" Icon="@Icons.Material.Filled.Sync" Disabled="@(!this.CanRefreshDataSource(context))" OnClick="() => this.RefreshDataSource(context)"/>
|
|
</MudTooltip>
|
|
@if (context is DataSourceERI_V1)
|
|
{
|
|
<AdminExportButton OnClick="@(() => this.ExportDataSource(context))" />
|
|
}
|
|
<MudTooltip Text="@T("Delete")">
|
|
<MudIconButton Color="Color.Error" Icon="@Icons.Material.Filled.Delete" OnClick="() => this.DeleteDataSource(context)"/>
|
|
</MudTooltip>
|
|
}
|
|
</MudStack>
|
|
</MudTd>
|
|
</RowTemplate>
|
|
</MudTable>
|
|
|
|
@if (this.SettingsManager.ConfigurationData.DataSources.Count == 0)
|
|
{
|
|
<MudText Typo="Typo.h6" Class="mt-3">
|
|
@T("No data sources configured yet.")
|
|
</MudText>
|
|
}
|
|
|
|
</DialogContent>
|
|
<DialogActions>
|
|
<MudStack Row="true" AlignItems="AlignItems.Center" Justify="Justify.SpaceBetween" Style="width: 100%;">
|
|
<MudMenu EndIcon="@Icons.Material.Filled.KeyboardArrowDown" Label="@T("Add Data Source")" Color="Color.Primary" Variant="Variant.Filled" AnchorOrigin="Origin.TopLeft" TransformOrigin="Origin.BottomLeft">
|
|
<MudMenuItem OnClick="() => this.AddDataSource(DataSourceType.ERI_V1)">
|
|
@T("External Data (ERI-Server v1)")
|
|
</MudMenuItem>
|
|
<MudMenuItem OnClick="() => this.AddDataSource(DataSourceType.LOCAL_DIRECTORY)">
|
|
@T("Local Directory")
|
|
</MudMenuItem>
|
|
<MudMenuItem OnClick="() => this.AddDataSource(DataSourceType.LOCAL_FILE)">
|
|
@T("Local File")
|
|
</MudMenuItem>
|
|
</MudMenu>
|
|
<MudButton OnClick="@this.Close" Variant="Variant.Filled">
|
|
@T("Close")
|
|
</MudButton>
|
|
</MudStack>
|
|
</DialogActions>
|
|
</MudDialog>
|