mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 23:38:00 +00:00
Tell whoever asked for a page what the search could not cover
This commit is contained in:
6 files changed
+168
-31
No files matched your search
@@ -0,0 +1,25 @@
|
||||
namespace AIStudio.Tools.RAG;
|
||||
|
||||
/// <summary>
|
||||
/// What kept a search from covering the whole data source.
|
||||
/// </summary>
|
||||
public enum RetrievalGap
|
||||
{
|
||||
/// <summary>
|
||||
/// The data source could not be searched at all, e.g., while it is being indexed again, or
|
||||
/// when its ERI server could not be reached.
|
||||
/// </summary>
|
||||
NOT_SEARCHED,
|
||||
|
||||
/// <summary>
|
||||
/// Part of the search failed, e.g., the vector search while the embedding provider is not
|
||||
/// available. The matches came from the rest of it and may be incomplete.
|
||||
/// </summary>
|
||||
PARTLY_SEARCHED,
|
||||
|
||||
/// <summary>
|
||||
/// The query could not be used for part of the search, e.g., because it is longer than the
|
||||
/// embedding model accepts. A shorter query would be searched in full.
|
||||
/// </summary>
|
||||
QUERY_NOT_SEARCHABLE,
|
||||
}
|
||||
@@ -19,4 +19,16 @@ public sealed record RetrievalPage(IReadOnlyList<IRetrievalContext> Contexts, bo
|
||||
/// 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; } = [];
|
||||
}
|
||||
Reference in new issue
Block a user