mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 18:27:21 +00:00
Added a way to read what the AI received from your sources (#1100)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
e0d8e18f34
commit
cbc4ce5413
229 files changed
+12739
-1269
No files matched your search
@@ -275,6 +275,7 @@ internal sealed partial class MailboxIndexer(SettingsManager settingsManager, Ru
|
||||
|
||||
var deletedMails = await this.ApplyRemovalsAsync(context, mailbox, plannedFolders, removals, runStartedUtc, token);
|
||||
await ForgetVanishedFailuresAsync(context, encounteredKeys, token);
|
||||
await ForgetVanishedAttemptsAsync(context, encounteredKeys, token);
|
||||
|
||||
var completedUtc = DateTimeOffset.UtcNow;
|
||||
await context.IndexStore.CompleteMailboxSyncAsync(mailbox.Id, completedUtc, token);
|
||||
@@ -529,6 +530,27 @@ internal sealed partial class MailboxIndexer(SettingsManager settingsManager, Ru
|
||||
await context.ForgetPermanentFailureAsync(key, token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes what failed attempts kept of mails which did not turn up during this run.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// An attempt which failed at the embedding provider keeps its vectors for the next one, under a
|
||||
/// row without chunks, cf. IndexedRunContext.CleanupFailedDocumentAsync. Such a mail has no
|
||||
/// location yet, so every run comes across it among the new mails, for as long as it belongs
|
||||
/// into the index. One which did not turn up is gone, and what its attempt kept would stay
|
||||
/// forever, hidden from every search, but asked about before each one.
|
||||
/// </remarks>
|
||||
private static async Task ForgetVanishedAttemptsAsync(IndexedRunContext context, IReadOnlySet<string> encounteredKeys, CancellationToken token)
|
||||
{
|
||||
foreach (var key in context.Manifest.UnfinishedFiles.Where(key => !encounteredKeys.Contains(key)).ToList())
|
||||
{
|
||||
token.ThrowIfCancellationRequested();
|
||||
await context.DeleteDocumentPointsAsync(key, token);
|
||||
await context.IndexStore.DeleteFileAsync(context.DataSource.Id, key, token);
|
||||
context.Manifest.UnfinishedFiles.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tells the user interface how the mailbox stands, from the index alone.
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user