using System.Linq.Expressions; namespace AIStudio.Settings.DataModel; /// /// Settings for indexing local data sources. /// /// The managed-configuration selector. public sealed class DataDataSourceIndexing(Expression>? configSelection = null) { /// /// The longest pause between two indexing steps either bound may ask for. /// public const int MAX_PAUSE_BETWEEN_STEPS_SECONDS = 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); }