mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-06 02:47:21 +00:00
Generated the JSON contracts of the stored data at compile time (#1148)
This commit is contained in:
1 parent
fc7399e81b
commit
e954881fda
75 files changed
+5437
-298
No files matched your search
@@ -8,53 +8,53 @@ namespace AIStudio.Settings.DataModel;
|
||||
/// <summary>
|
||||
/// Represents one local file as a data source.
|
||||
/// </summary>
|
||||
public readonly record struct DataSourceLocalFile : IInternalDataSource
|
||||
public record struct DataSourceLocalFile: IInternalDataSource
|
||||
{
|
||||
public DataSourceLocalFile()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint Num { get; init; }
|
||||
public uint Num { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Id { get; init; } = Guid.Empty.ToString();
|
||||
public string Id { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The description of the data source. What kind of data does it contain?
|
||||
/// What is the data source used for?
|
||||
/// </summary>
|
||||
public string Description { get; init; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public DataSourceType Type { get; init; } = DataSourceType.NONE;
|
||||
public DataSourceType Type { get; set; } = DataSourceType.NONE;
|
||||
|
||||
/// <inheritdoc />
|
||||
public string EmbeddingId { get; init; } = Guid.Empty.ToString();
|
||||
public string EmbeddingId { get; set; } = Guid.Empty.ToString();
|
||||
|
||||
/// <inheritdoc />
|
||||
public int MaxChunkTokenLength { get; init; }
|
||||
public int MaxChunkTokenLength { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int ChunkOverlapTokenLength { get; init; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
public int ChunkOverlapTokenLength { get; set; } = DataSourceEmbeddingService.DEFAULT_CHUNK_OVERLAP_TOKEN_LENGTH;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ConfidenceLevel ConfidenceLevel { get; init; } = ConfidenceLevel.UNKNOWN;
|
||||
public ConfidenceLevel ConfidenceLevel { get; set; } = ConfidenceLevel.UNKNOWN;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsEnterpriseConfiguration { get; init; }
|
||||
public bool IsEnterpriseConfiguration { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public Guid EnterpriseConfigurationPluginId { get; init; } = Guid.Empty;
|
||||
public Guid EnterpriseConfigurationPluginId { get; set; } = Guid.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ushort MaxMatches { get; init; } = 10;
|
||||
public ushort MaxMatches { get; set; } = 10;
|
||||
|
||||
/// <inheritdoc />
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; init; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
public OutboundDataRestriction OutboundDataRestriction { get; set; } = DataSourceOutboundDataExtensions.DEFAULT_OUTBOUND_DATA_RESTRICTION;
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<IRetrievalContext>> RetrieveDataAsync(IContent lastUserPrompt, ChatThread thread, CancellationToken token = default) =>
|
||||
@@ -67,5 +67,5 @@ public readonly record struct DataSourceLocalFile : IInternalDataSource
|
||||
/// <summary>
|
||||
/// The path to the file.
|
||||
/// </summary>
|
||||
public string FilePath { get; init; } = string.Empty;
|
||||
public string FilePath { get; set; } = string.Empty;
|
||||
}
|
||||
Reference in new issue
Block a user