2025-02-17 13:12:46 +00:00
|
|
|
using AIStudio.Chat;
|
|
|
|
using AIStudio.Tools.RAG;
|
|
|
|
|
2025-01-13 18:51:26 +00:00
|
|
|
namespace AIStudio.Settings.DataModel;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Represents a local directory as a data source.
|
|
|
|
/// </summary>
|
|
|
|
public readonly record struct DataSourceLocalDirectory : IInternalDataSource
|
|
|
|
{
|
|
|
|
public DataSourceLocalDirectory()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public uint Num { get; init; }
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public string Id { get; init; } = Guid.Empty.ToString();
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public string Name { get; init; } = string.Empty;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public string EmbeddingId { get; init; } = Guid.Empty.ToString();
|
|
|
|
|
2025-02-15 14:41:12 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
public DataSourceSecurity SecurityPolicy { get; init; } = DataSourceSecurity.NOT_SPECIFIED;
|
|
|
|
|
2025-02-17 13:12:46 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
public Task<IReadOnlyList<IRetrievalContext>> RetrieveDataAsync(IContent lastPrompt, ChatThread thread, CancellationToken token = default)
|
|
|
|
{
|
|
|
|
IReadOnlyList<IRetrievalContext> retrievalContext = new List<IRetrievalContext>();
|
|
|
|
return Task.FromResult(retrievalContext);
|
|
|
|
}
|
|
|
|
|
2025-01-13 18:51:26 +00:00
|
|
|
/// <summary>
|
|
|
|
/// The path to the directory.
|
|
|
|
/// </summary>
|
|
|
|
public string Path { get; init; } = string.Empty;
|
|
|
|
}
|