mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 06:38:00 +00:00
Added retrieval integration, part I (#281)
This commit is contained in:
1 parent
e973b51f75
commit
954cf44939
18 files changed
+477
-31
No files matched your search
@@ -0,0 +1,43 @@
|
||||
namespace AIStudio.Tools.RAG;
|
||||
|
||||
/// <summary>
|
||||
/// The retrieval context for text data.
|
||||
/// </summary>
|
||||
public sealed class RetrievalTextContext : IRetrievalContext
|
||||
{
|
||||
#region Implementation of IRetrievalContext
|
||||
|
||||
/// <inheritdoc />
|
||||
public required string DataSourceName { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public required RetrievalContentCategory Category { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public required RetrievalContentType Type { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public required string Path { get; init; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IReadOnlyList<string> Links { get; init; } = [];
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// The text content.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Should contain the matched text and some small context around it.
|
||||
/// </remarks>
|
||||
public required string MatchedText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The surrounding content of the matched text.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Might give the user some context about the matched text.
|
||||
/// For example, one sentence or paragraph before and after the matched text.
|
||||
/// </remarks>
|
||||
public IReadOnlyList<string> SurroundingContent { get; set; } = [];
|
||||
}
|
||||
Reference in new issue
Block a user