@attribute [Route(Routes.EMBEDDINGS)] @inherits MSGComponentBase @using AIStudio.Provider @T("Background embeddings") @T("AI Studio indexes local RAG data sources in the background. Finished files stay recorded so unchanged files can be skipped after a restart, while added or deleted files are detected during the next run. The same applies to documents without readable text, such as scanned pages: AI Studio remembers them and reads them again only once they change.") @string.Format(T("Indexed files: {0}"), this.TotalIndexedFiles) @string.Format(T("Pending files: {0}"), this.TotalPendingFiles) @string.Format(T("Skipped files: {0}"), this.TotalPermanentlySkippedFiles) @string.Format(T("Failed files: {0}"), this.TotalFailedFiles) @if (this.Statuses.Count == 0) { @T("No local data source has been queued for embedding yet.") } else { @foreach (var status in this.Statuses) { @status.DataSourceName @status.StateLabel @if (CanRefresh(status)) { } @string.Format(T("{0} of {1} files are indexed."), status.IndexedFiles, status.TotalFiles) @if (status.PermanentlySkippedFiles > 0) { @string.Format(T("Skipped files: {0}. AI Studio reads them again once they change."), status.PermanentlySkippedFiles) } @if (status.FailedFiles > 0) { @string.Format(T("Failed files: {0}"), status.FailedFiles) } @if (!string.IsNullOrWhiteSpace(status.CurrentFile)) { @string.Format(T("Current file: {0}"), status.CurrentFile) } @if (status.Failures.Count > 0) { @foreach (var failure in status.Failures) { @failure.FilePath @failure.Reason @if (failure.IsPermanent) { @T("Skipped until the file changes") } @if (failure.FailureReason is not ProviderRequestFailureReason.NONE) { @failure.FailureReason.GetName() } @if (!string.IsNullOrWhiteSpace(failure.EmbeddingProviderName)) { @string.Format(T("Embedding provider: {0}"), failure.EmbeddingProviderName) } @if (failure.OccurredAtUtc > DateTimeOffset.MinValue) { @failure.OccurredAtUtc.ToLocalTime().ToString("g") } @if (failure.FailureReason.IsFixedInProviderSettings()) { @T("Open the settings") } } } @* Shown next to the list, not instead of it: the list says which files failed, while this is the one sentence about the data source as a whole. Hiding it as soon as a single file failed is what made it invisible in practice. *@ @if (!string.IsNullOrWhiteSpace(status.LastError)) { @status.LastError } } }