Files
AI-Studio/app/MindWork AI Studio/Settings/DataModel/DataDataSourceIndexing.cs
T

41 lines
1.6 KiB
C#
Raw Normal View History

using System.Linq.Expressions;
2026-09-09 18:43:37 +02:00
namespace AIStudio.Settings.DataModel;
/// <summary>
/// Settings for indexing local data sources.
/// </summary>
/// <param name="configSelection">The managed-configuration selector.</param>
public sealed class DataDataSourceIndexing(Expression<Func<Data, DataDataSourceIndexing>>? configSelection = null)
2026-09-09 18:43:37 +02:00
{
/// <summary>
/// The longest pause between two indexing steps either bound may ask for.
/// </summary>
public const int MAX_PAUSE_BETWEEN_STEPS_SECONDS = 300;
/// <summary>
/// Initializes an unmanaged instance, e.g., for the JSON deserializer.
/// </summary>
public DataDataSourceIndexing() : this(null)
{
}
2026-09-09 18:43:37 +02:00
/// <summary>
/// Whether local data source embeddings should refresh automatically when files change.
/// </summary>
public bool AutomaticRefresh { get; set; } = true;
/// <summary>
/// The lower bound of the random pause between two indexing steps, in seconds.
/// </summary>
/// <remarks>
/// The pause spares an embedding server which many people share, e.g., in an organization. Zero
/// together with a zero upper bound means no pause.
/// </remarks>
public int MinimumPauseBetweenStepsSeconds { get; set; } = ManagedConfiguration.Register(configSelection, n => n.MinimumPauseBetweenStepsSeconds, 0);
/// <summary>
/// The upper bound of the random pause between two indexing steps, in seconds.
/// </summary>
public int MaximumPauseBetweenStepsSeconds { get; set; } = ManagedConfiguration.Register(configSelection, n => n.MaximumPauseBetweenStepsSeconds, 0);
2026-09-09 18:43:37 +02:00
}