AI-Studio/app/MindWork AI Studio/Tools/RAG/RetrievalPage.cs
Thorsten Sommer 1eaca9b12f
Some checks are pending
Build and Release / Determine run mode (push) Waiting to run
Build and Release / Read metadata (push) Blocked by required conditions
Build and Release / Sync Flatpak repo (push) Blocked by required conditions
Build and Release / Collect Flatpak artifacts (push) Blocked by required conditions
Build and Release / Verify (push) Waiting to run
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Blocked by required conditions
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Blocked by required conditions
Build and Release / Prepare & create release (push) Blocked by required conditions
Build and Release / Publish release (push) Blocked by required conditions
Added a semantic search tool (#1005)
2026-09-27 16:26:52 +02:00

34 lines
1.7 KiB
C#

namespace AIStudio.Tools.RAG;
/// <summary>
/// One page of what a search in a data source found.
/// </summary>
/// <remarks>
/// A page does not say how many matches there are in total, and it could not: a vector search has
/// no total, since every chunk matches, only less similar ones match less. What a page does say is
/// whether asking for the next one is worth it.
/// </remarks>
/// <param name="Contexts">What this page found, the most relevant first.</param>
/// <param name="HasMore">True when the next page can be retrieved and may hold further matches. That
/// page can still turn out empty, when everything on it was already shown on an earlier page. False
/// when the search is exhausted, or when this page is the last one which can be retrieved at all, cf.
/// RetrievalPaging.GetLastPage.</param>
public sealed record RetrievalPage(IReadOnlyList<IRetrievalContext> Contexts, bool HasMore)
{
/// <summary>
/// A page without any matches and nothing after it.
/// </summary>
public static readonly RetrievalPage EMPTY = new([], false);
/// <summary>
/// What kept the search from covering the whole data source. Empty when nothing did.
/// </summary>
/// <remarks>
/// Without this, a data source which could not be searched would look like one which found
/// nothing, and the model would tell the user their documents do not mention what they might
/// well mention. A local data source tells the user about its own problems as well, since only
/// the user can fix those. Not so about problems of the query: it was written by whoever asked
/// for this page, and so is a better one.
/// </remarks>
public IReadOnlyList<RetrievalGap> Gaps { get; init; } = [];
}