namespace AIStudio.Tools.RAG;
///
/// The retrieval context for text data.
///
public sealed class RetrievalTextContext : IRetrievalContext
{
#region Implementation of IRetrievalContext
///
public required string DataSourceName { get; init; }
///
public required RetrievalContentCategory Category { get; init; }
///
public required RetrievalContentType Type { get; init; }
///
public required string Path { get; init; }
///
public IReadOnlyList Links { get; init; } = [];
#endregion
///
/// The text content.
///
///
/// Should contain the matched text and some small context around it.
///
public required string MatchedText { get; set; }
///
/// The surrounding content of the matched text.
///
///
/// Might give the user some context about the matched text.
/// For example, one sentence or paragraph before and after the matched text.
///
public IReadOnlyList SurroundingContent { get; set; } = [];
///
/// Optional title used when this context is displayed as a source reference.
///
public string ReferenceTitle { get; init; } = string.Empty;
///
/// Optional link used when this context is displayed as a source reference.
///
public string ReferenceLink { get; init; } = string.Empty;
///
/// The page this passage was found on, or null when it has none.
///
///
/// Kept as a number rather than only inside the reference title: the AI is told the page so it
/// can say where an answer comes from, and a source has to name a page a program can be sent
/// to. A slide or a sheet has no page and leaves this empty.
///
public int? PageNumber { get; init; }
}