using System.Linq.Expressions; using AIStudio.Tools.Pauses; namespace AIStudio.Settings.DataModel; /// /// Settings for indexing local data sources. /// /// The managed-configuration selector. public sealed class DataDataSourceIndexing(Expression>? configSelection = null) { /// /// The pauses between two indexing steps either bound may ask for: none at all, up to 300 seconds. /// public static readonly PauseLimits PAUSE_LIMITS = new(0, 300); /// /// Initializes an unmanaged instance, e.g., for the JSON deserializer. /// public DataDataSourceIndexing() : this(null) { } /// /// Whether local data source embeddings should refresh automatically when files change. /// public bool AutomaticRefresh { get; set; } = true; /// /// The lower bound of the random pause between two indexing steps, in seconds. /// /// /// 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. /// public int MinimumPauseBetweenStepsSeconds { get; set; } = ManagedConfiguration.Register(configSelection, n => n.MinimumPauseBetweenStepsSeconds, 0); /// /// The upper bound of the random pause between two indexing steps, in seconds. /// public int MaximumPauseBetweenStepsSeconds { get; set; } = ManagedConfiguration.Register(configSelection, n => n.MaximumPauseBetweenStepsSeconds, 0); }