Improved the pauses between indexing steps and between files of the Batch Processing Assistant (#1240)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-27 14:39:17 +01:00
1 parent a117074972
commit 899139c88b
32 files changed
+787 -425

No files matched your search

@@ -200,18 +200,9 @@ else
@T("Processing pace")
</MudText>
@if (MinimumDelayIsManaged)
{
<MudAlert Severity="Severity.Info" Dense="true" Class="mb-3">
@(string.Format(TA("Your organization requires a pause of at least {0} seconds between files."), this.ManagedMinimumDelaySeconds))
</MudAlert>
}
else
{
<MudTextSlider T="int" Label="@T("Minimum pause between files")" Min="@DataBatchProcessing.MIN_DELAY_SECONDS" Max="@DataBatchProcessing.MAX_DELAY_SECONDS" Step="1" Unit="@T("seconds")" @bind-Value="@this.minimumDelaySeconds" Disabled="@(() => this.isProcessingBatch)"/>
}
<MudTextSlider T="int" Label="@T("Maximum pause between files")" Min="@this.EffectiveMinimumDelaySeconds" Max="@DataBatchProcessing.MAX_DELAY_SECONDS" Step="1" Unit="@T("seconds")" @bind-Value="@this.maximumDelaySeconds" Disabled="@(() => this.isProcessingBatch)"/>
<ConfigurationPauseRange Limits="@DataBatchProcessing.PAUSE_LIMITS" IsSetting="false" Disabled="@(() => this.isProcessingBatch)" OptionDescription="@T("Pause between files")"
Minimum="@(() => this.MinimumDelaySeconds)" MinimumUpdate="@(value => this.minimumDelaySeconds = value)" IsMinimumLocked="@(() => DataBatchProcessing.IsMinimumPauseLocked)"
Maximum="@(() => this.MaximumDelaySeconds)" MaximumUpdate="@(value => this.maximumDelaySeconds = value)" IsMaximumLocked="@(() => DataBatchProcessing.IsMaximumPauseLocked)"/>
<MudJustifiedText Typo="Typo.body2" Class="mb-3">
@T("Before the next file starts, AI Studio waits for a random number of whole seconds from this interval. The minimum is always 6 seconds and the maximum is 300 seconds (5 minutes). Restored files and the end of a run do not add another pause.")
@@ -1,5 +1,5 @@
using AIStudio.Settings;
using AIStudio.Settings.DataModel;
using AIStudio.Tools.Pauses;
using Microsoft.AspNetCore.Components;
@@ -10,27 +10,40 @@ public partial class AssistantBatchProcessing
[Inject]
private ThreadSafeRandom Rng { get; init; } = null!;
private static bool MinimumDelayIsManaged => ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.MinimumDelaySeconds, out var meta)
&& meta.ManagedMode is not null;
/// <summary>
/// The lower bound of the pause between two files as it stands.
/// </summary>
/// <remarks>
/// A bound which a configuration plugin locks belongs to the organization, so it comes from the
/// settings, whatever this assistant held before, e.g., in a session from before the lock.
/// </remarks>
private int MinimumDelaySeconds => DataBatchProcessing.IsMinimumPauseLocked
? this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds
: this.minimumDelaySeconds;
private int ManagedMinimumDelaySeconds => Math.Clamp(this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds,
DataBatchProcessing.MIN_DELAY_SECONDS,
DataBatchProcessing.MAX_DELAY_SECONDS);
/// <summary>
/// The upper bound of the pause between two files as it stands, cf. MinimumDelaySeconds.
/// </summary>
private int MaximumDelaySeconds => DataBatchProcessing.IsMaximumPauseLocked
? this.SettingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds
: this.maximumDelaySeconds;
private int EffectiveMinimumDelaySeconds => MinimumDelayIsManaged ? this.ManagedMinimumDelaySeconds
: Math.Clamp(this.minimumDelaySeconds, DataBatchProcessing.MIN_DELAY_SECONDS, DataBatchProcessing.MAX_DELAY_SECONDS);
private (int Minimum, int Maximum) GetEffectiveDelayRange()
{
var minimum = this.EffectiveMinimumDelaySeconds;
var maximum = Math.Clamp(this.maximumDelaySeconds, minimum, DataBatchProcessing.MAX_DELAY_SECONDS);
return (minimum, maximum);
}
/// <summary>
/// The bounds of the pause between two files which apply to a run, cf. PauseRange.GetEffective.
/// </summary>
private PauseRange EffectivePauseRange => PauseRange.GetEffective(
DataBatchProcessing.PAUSE_LIMITS,
this.MinimumDelaySeconds,
() => DataBatchProcessing.IsMinimumPauseLocked,
this.MaximumDelaySeconds,
() => DataBatchProcessing.IsMaximumPauseLocked);
/// <summary>
/// Waits for a random, inclusive duration before the next file starts.
/// </summary>
private async Task WaitBeforeNextFileAsync(int minimumSeconds, int maximumSeconds, CancellationToken token)
/// <param name="range">The bounds of the pause, as they apply to the run.</param>
/// <param name="token">Ends the wait when the user stops the run.</param>
private async Task WaitBeforeNextFileAsync(PauseRange range, CancellationToken token)
{
if (token.IsCancellationRequested)
return;
@@ -38,12 +51,12 @@ public partial class AssistantBatchProcessing
// ThreadSafeRandom is the application-wide singleton. Batch runs must
// not create private Random instances because several runs may execute
// concurrently in different assistant sessions.
this.pauseBeforeNextFileSeconds = this.Rng.Next(minimumSeconds, maximumSeconds + 1);
this.pauseBeforeNextFileSeconds = this.Rng.Next(range.MinimumSeconds, range.MaximumSeconds + 1);
this.Logger.LogInformation("Batch processing waits {DelaySeconds} seconds before starting the next file.", this.pauseBeforeNextFileSeconds);
await this.CheckpointAssistantSession();
await this.RefreshAssistantUIAsync();
try
{
await Task.Delay(TimeSpan.FromSeconds(this.pauseBeforeNextFileSeconds), token);
@@ -119,7 +119,7 @@ public partial class AssistantBatchProcessing
{
this.isProcessingBatch = true;
var stopwatch = Stopwatch.StartNew();
var delayRange = this.GetEffectiveDelayRange();
var pauseRange = this.EffectivePauseRange;
this.Logger.LogInformation(
"Batch processing started. InputDirectory='{InputDirectory}', OutputDirectory='{OutputDirectory}', TotalFiles={TotalFiles}, RestoredFiles={RestoredFiles}, Model='{Model}', MinimumDelaySeconds={MinimumDelaySeconds}, MaximumDelaySeconds={MaximumDelaySeconds}.",
this.inputDirectory,
@@ -127,8 +127,8 @@ public partial class AssistantBatchProcessing
this.fileResults.Count,
this.fileResults.Count(fileResult => fileResult.Status is BatchProcessingFileStatus.DONE),
this.ProviderSettings.Model,
delayRange.Minimum,
delayRange.Maximum);
pauseRange.MinimumSeconds,
pauseRange.MaximumSeconds);
// We use the cancellation token of the assistant base class, which
// creates it before it calls us and disposes it after we returned.
@@ -166,7 +166,7 @@ public partial class AssistantBatchProcessing
var anotherFileIsWaiting = this.fileResults.Skip(index + 1).Any(nextFile => nextFile.Status is not BatchProcessingFileStatus.DONE);
if (anotherFileIsWaiting)
await this.WaitBeforeNextFileAsync(delayRange.Minimum, delayRange.Maximum, token);
await this.WaitBeforeNextFileAsync(pauseRange, token);
}
}
finally
@@ -213,8 +213,8 @@ public partial class AssistantBatchProcessing : AssistantBaseCore<SettingsDialog
this.csvFileName = string.Empty;
this.csvSeparator = BatchProcessingCsvSeparator.SEMICOLON;
this.customCsvSeparator = string.Empty;
this.minimumDelaySeconds = MinimumDelayIsManaged ? this.ManagedMinimumDelaySeconds : DataBatchProcessing.DEFAULT_MIN_DELAY_SECONDS;
this.maximumDelaySeconds = Math.Clamp(DataBatchProcessing.DEFAULT_MAX_DELAY_SECONDS, this.minimumDelaySeconds, DataBatchProcessing.MAX_DELAY_SECONDS);
this.minimumDelaySeconds = DataBatchProcessing.DEFAULT_MIN_DELAY_SECONDS;
this.maximumDelaySeconds = DataBatchProcessing.DEFAULT_MAX_DELAY_SECONDS;
return;
}
@@ -236,9 +236,8 @@ public partial class AssistantBatchProcessing : AssistantBaseCore<SettingsDialog
this.csvFileName = settings.CsvFileName;
this.csvSeparator = settings.CsvSeparator;
this.customCsvSeparator = settings.CustomCsvSeparator;
this.minimumDelaySeconds = MinimumDelayIsManaged ? this.ManagedMinimumDelaySeconds
: Math.Clamp(settings.MinimumDelaySeconds, DataBatchProcessing.MIN_DELAY_SECONDS, DataBatchProcessing.MAX_DELAY_SECONDS);
this.maximumDelaySeconds = Math.Clamp(settings.MaximumDelaySeconds, this.minimumDelaySeconds, DataBatchProcessing.MAX_DELAY_SECONDS);
this.minimumDelaySeconds = settings.MinimumDelaySeconds;
this.maximumDelaySeconds = settings.MaximumDelaySeconds;
}
private async Task LoadConfiguredPromptFileAsync()
@@ -421,12 +421,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- These tools are part of the selected policy and cannot be changed here. Every tool has to meet the confidence requirements of the selected provider, so a tool may stay unavailable even when the policy permits it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1133257227"] = "These tools are part of the selected policy and cannot be changed here. Every tool has to meet the confidence requirements of the selected provider, so a tool may stay unavailable even when the policy permits it."
-- Your organization requires a pause of at least {0} seconds between files.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1155517317"] = "Your organization requires a pause of at least {0} seconds between files."
-- Your organization requires a pause of at least {0} seconds between files.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1155517317::INFORMAL"] = "Your organization requires a pause of at least {0} seconds between files."
-- The results table contains one row per document, starting with the file name. Here you can name the column that holds the AI answer, e.g., Summary. When left empty, we use 'Result'.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1164512104"] = "The results table contains one row per document, starting with the file name. Here you can name the column that holds the AI answer, e.g., Summary. When left empty, we use 'Result'."
@@ -508,18 +502,12 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- Waiting {0} seconds before starting the next file.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1708373046"] = "Waiting {0} seconds before starting the next file."
-- seconds
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1723256298"] = "seconds"
-- The selected folder does not exist.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T17705912"] = "The selected folder does not exist."
-- The image was no longer available while the model was asked about it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1805791865"] = "The image was no longer available while the model was asked about it."
-- Minimum pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1829787634"] = "Minimum pause between files"
-- Was not able to read the input folder: {0}
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1871021621"] = "Was not able to read the input folder: {0}"
@@ -667,9 +655,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- The selected model cannot read images, so the {0} images among the selected files will fail. All other files are processed as usual.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T324865195"] = "The selected model cannot read images, so the {0} images among the selected files will fail. All other files are processed as usual."
-- Maximum pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T3250003796"] = "Maximum pause between files"
-- Please select the folder that contains the documents you want to process.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T33077198"] = "Please select the folder that contains the documents you want to process."
@@ -841,6 +826,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- The selected model cannot read images, so the image among the selected files will fail. All other files are processed as usual.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T9738678"] = "The selected model cannot read images, so the image among the selected files will fail. All other files are processed as usual."
-- Pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T976137570"] = "Pause between files"
-- Comma (,)
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::BATCHPROCESSINGCSVSEPARATOREXTENSIONS::T1676507543"] = "Comma (,)"
@@ -8752,6 +8740,15 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONMULTISELECT::T95098799"] = "
-- You have selected 1 item.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONMULTISELECT::T95098799::INFORMAL"] = "You have selected 1 item."
-- No pause
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T1202649384"] = "No pause"
-- {0} seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T2586010064"] = "{0} seconds"
-- {0} to {1} seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T4176272400"] = "{0} to {1} seconds"
-- Preselected provider
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPROVIDERSELECTION::T1469984996"] = "Preselected provider"
@@ -9235,9 +9232,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1084943026::INFORM
-- Automatic local data source refresh
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1208397349"] = "Automatic local data source refresh"
-- Shortest pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1308136668"] = "Shortest pause between indexing steps"
-- Refresh
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T135637716"] = "Refresh"
@@ -9259,12 +9253,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1592527757"] = "Ca
-- External (ERI)
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1652430727"] = "External (ERI)"
-- Longest pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1654263778"] = "Longest pause between indexing steps"
-- seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1723256298"] = "seconds"
-- Delete Data Source
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1849107431"] = "Delete Data Source"
@@ -9274,15 +9262,15 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2067030738"] = "Ar
-- Are you sure you want to delete the mailbox '{0}'? Your mails stay on the server as they are. AI Studio only deletes its index of them and the stored password.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2067030738::INFORMAL"] = "Are you sure you want to delete the mailbox '{0}'? Your mails stay on the server as they are. AI Studio only deletes its index of them and the stored password."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2111903307"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2111903307::INFORMAL"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause."
-- Local Directory Data Source Information
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2146756020"] = "Local Directory Data Source Information"
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2352821039"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2352821039::INFORMAL"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause."
-- Local data sources refresh when files change, mailboxes every 16 minutes.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2511157475"] = "Local data sources refresh when files change, mailboxes every 16 minutes."
@@ -9337,9 +9325,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3337072977"] = "Ar
-- Are you sure you want to delete the data source '{0}' of type '{1}'?
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3337072977::INFORMAL"] = "Are you sure you want to delete the data source '{0}' of type '{1}'?"
-- The upper end of the random pause between two indexing steps. AI Studio allows up to 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3401303590"] = "The upper end of the random pause between two indexing steps. AI Studio allows up to 300 seconds (5 minutes)."
-- Unknown
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3424652889"] = "Unknown"
@@ -9382,6 +9367,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4108252513"] = "Wa
-- Information
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4256323669"] = "Information"
-- Pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4289321676"] = "Pause between indexing steps"
-- Cannot export this ERI data source because no enterprise encryption secret is configured.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T750361472"] = "Cannot export this ERI data source because no enterprise encryption secret is configured."
@@ -15949,12 +15937,12 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTSPAGE::T786
-- Collapsing a category keeps the assistants page tidy. Choose whether AI Studio keeps offering its assistants elsewhere, e.g., in the "Send to ..." menu.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTSPAGE::T786145170::INFORMAL"] = "Collapsing a category keeps the assistants page tidy. Choose whether AI Studio keeps offering its assistants elsewhere, e.g., in the \"Send to ...\" menu."
-- Default minimum pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1008440099"] = "Default minimum pause between files"
-- Instructions
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1221801316"] = "Instructions"
-- Default pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1294143443"] = "Default pause between files"
-- Include hidden files and folders by default?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1450016875"] = "Include hidden files and folders by default?"
@@ -15967,9 +15955,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T15
-- Hidden are files and folders whose names start with a dot, such as .git or .env, and those hidden by the operating system. A file pattern which starts with a dot, such as .gitignore, selects such files anyway.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1624717965"] = "Hidden are files and folders whose names start with a dot, such as .git or .env, and those hidden by the operating system. A file pattern which starts with a dot, such as .gitignore, selects such files anyway."
-- seconds
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1723256298"] = "seconds"
-- Default prompt
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1750564968"] = "Default prompt"
@@ -16006,9 +15991,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T23
-- Separate multiple file patterns with a semicolon, e.g., *.pdf;*.docx. The standard patterns include all supported audio and video formats as well as images in JPG, PNG, WebP, GIF, BMP, and TIFF format.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T232588799::INFORMAL"] = "Separate multiple file patterns with a semicolon, e.g., *.pdf;*.docx. The standard patterns include all supported audio and video formats as well as images in JPG, PNG, WebP, GIF, BMP, and TIFF format."
-- The lower end of the random pause interval. AI Studio never allows less than 6 seconds.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T237774509"] = "The lower end of the random pause interval. AI Studio never allows less than 6 seconds."
-- A policy brings its own tools, so there is nothing to preselect here. You configure them with the policy in the Document Analysis Assistant.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T2391906382"] = "A policy brings its own tools, so there is nothing to preselect here. You configure them with the policy in the Document Analysis Assistant."
@@ -16051,9 +16033,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T29
-- Only the selected folder is processed
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T2958253681"] = "Only the selected folder is processed"
-- Default maximum pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3011459001"] = "Default maximum pause between files"
-- Include subfolders by default?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3106330739"] = "Include subfolders by default?"
@@ -16078,21 +16057,12 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T34
-- Processing pace
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3428873429"] = "Processing pace"
-- The upper end of the random pause interval. The app-wide maximum is 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3434290122"] = "The upper end of the random pause interval. The app-wide maximum is 300 seconds (5 minutes)."
-- Close
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3448155331"] = "Close"
-- The current content of this Markdown file is loaded whenever the defaults are applied.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3468539567"] = "The current content of this Markdown file is loaded whenever the defaults are applied."
-- Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3663516199"] = "Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit."
-- Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3663516199::INFORMAL"] = "Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit."
-- Load default prompt from file
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3763644960"] = "Load default prompt from file"
@@ -16147,6 +16117,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T70
-- Restore default patterns
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T7425959"] = "Restore default patterns"
-- Before the next file starts, AI Studio waits for a random time within this range, at least 6 seconds and at most 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T754486332"] = "Before the next file starts, AI Studio waits for a random time within this range, at least 6 seconds and at most 300 seconds (5 minutes)."
-- Leave empty when an input folder should be selected for every batch run.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T762890100"] = "Leave empty when an input folder should be selected for every batch run."
@@ -0,0 +1,6 @@
@inherits ConfigurationBaseCore
@{ var range = this.EffectiveRange; }
<MudRangeSlider T="int" Range="true" Min="@this.TrackMin" Max="@this.TrackMax" Step="@STEP_SECONDS" MinDistance="0" TickMarks="true" Variant="Variant.Filled" Size="Size.Medium" ValueLabel="true" Immediate="true" Value="@range.MinimumSeconds" ValueChanged="@this.UpdateMinimum" UpperValue="@range.MaximumSeconds" UpperValueChanged="@this.UpdateMaximum" Disabled="@this.Disabled()" DisableMin="@this.IsMinimumLocked()" DisableMax="@this.IsMaximumLocked()" Class="mb-1">
@this.GetRangeText(range)
</MudRangeSlider>
@@ -0,0 +1,194 @@
using AIStudio.Tools.Pauses;
using Microsoft.AspNetCore.Components;
using Timer = System.Timers.Timer;
namespace AIStudio.Components;
/// <summary>
/// One slider with two handles for a random pause, e.g., between two indexing steps: the shortest and the longest pause.
/// </summary>
/// <remarks>
/// The slider shows the bounds which apply, as PauseRange.GetEffective works them out, and stores
/// them that way: pushing the lower handle past the upper one takes the upper one along. A bound
/// which a configuration plugin locks keeps its value, its handle cannot move, and the option shows
/// a lock. The handles move in steps of five seconds; a bound off these steps, e.g., one which a
/// configuration plugin sets, applies as it is, and only its handle shows the nearest step.
/// </remarks>
public partial class ConfigurationPauseRange : ConfigurationBaseCore
{
/// <summary>
/// The seconds between two tick marks, and the step of the handles.
/// </summary>
private const int STEP_SECONDS = 5;
/// <summary>
/// Initializes the component, which shows the lock of the option while either bound is locked.
/// </summary>
public ConfigurationPauseRange()
{
this.IsLocked = () => this.IsMinimumLocked() || this.IsMaximumLocked();
}
/// <summary>
/// The shortest and the longest pause the feature allows.
/// </summary>
[Parameter, EditorRequired]
public PauseLimits Limits { get; set; } = null!;
/// <summary>
/// The lower bound as set.
/// </summary>
[Parameter]
public Func<int> Minimum { get; set; } = () => 0;
/// <summary>
/// Sets the lower bound.
/// </summary>
[Parameter]
public Action<int> MinimumUpdate { get; set; } = _ => { };
/// <summary>
/// Whether a configuration plugin locks the lower bound.
/// </summary>
[Parameter]
public Func<bool> IsMinimumLocked { get; set; } = () => false;
/// <summary>
/// The upper bound as set.
/// </summary>
[Parameter]
public Func<int> Maximum { get; set; } = () => 0;
/// <summary>
/// Sets the upper bound.
/// </summary>
[Parameter]
public Action<int> MaximumUpdate { get; set; } = _ => { };
/// <summary>
/// Whether a configuration plugin locks the upper bound.
/// </summary>
[Parameter]
public Func<bool> IsMaximumLocked { get; set; } = () => false;
/// <summary>
/// Whether the bounds are settings, which a change stores and announces to the other options.
/// </summary>
/// <remarks>
/// Defaults to true. False for bounds which live elsewhere, e.g., in the session of an assistant.
/// </remarks>
[Parameter]
public bool IsSetting { get; set; } = true;
/// <summary>
/// Stores the settings once the user stopped moving a handle: storing them with every step
/// would make the slider stutter, since the store runs a while.
/// </summary>
private readonly Timer storeTimer = new(TimeSpan.FromMilliseconds(500))
{
AutoReset = false
};
/// <summary>
/// Whether a change waits for storeTimer.
/// </summary>
private bool isStorePending;
private PauseRange EffectiveRange => PauseRange.GetEffective(this.Limits, this.Minimum(), this.IsMinimumLocked, this.Maximum(), this.IsMaximumLocked);
/// <summary>
/// The start of the track: the shortest pause, or the step right below it.
/// </summary>
private int TrackMin => this.Limits.ShortestSeconds / STEP_SECONDS * STEP_SECONDS;
/// <summary>
/// The end of the track: the longest pause, or the step right above it.
/// </summary>
private int TrackMax => (this.Limits.LongestSeconds + STEP_SECONDS - 1) / STEP_SECONDS * STEP_SECONDS;
#region Overrides of ConfigurationBase
/// <inheritdoc />
protected override bool Stretch => true;
/// <inheritdoc />
protected override Variant Variant => Variant.Outlined;
protected override string Label => this.OptionDescription;
#endregion
#region Overrides of ComponentBase
protected override async Task OnInitializedAsync()
{
// Off the renderer, which stays free while the settings are stored:
this.storeTimer.Elapsed += (_, _) => this.StoreAsync().Observe($"{nameof(ConfigurationPauseRange)}: storing the changed pause");
await base.OnInitializedAsync();
}
#endregion
#region Overrides of MSGComponentBase
protected override void DisposeResources()
{
this.storeTimer.Stop();
this.storeTimer.Dispose();
// A change made right before closing still reaches the disk:
if (this.isStorePending)
this.StoreAsync().Observe($"{nameof(ConfigurationPauseRange)}: storing the changed pause while closing");
base.DisposeResources();
}
#endregion
private string GetRangeText(PauseRange range)
{
if (range.IsNone)
return T("No pause");
return range.MinimumSeconds == range.MaximumSeconds
? string.Format(T("{0} seconds"), range.MinimumSeconds)
: string.Format(T("{0} to {1} seconds"), range.MinimumSeconds, range.MaximumSeconds);
}
private void UpdateMinimum(int seconds) => this.ApplyBounds(seconds, this.Maximum());
private void UpdateMaximum(int seconds) => this.ApplyBounds(this.Minimum(), seconds);
/// <summary>
/// Sets both bounds as they apply, so that the handles show what is stored.
/// </summary>
/// <remarks>
/// A locked bound keeps its value, even when the slider reports another one, e.g., while it
/// puts its handles in order.
/// </remarks>
private void ApplyBounds(int minimumSeconds, int maximumSeconds)
{
var range = PauseRange.GetEffective(this.Limits, minimumSeconds, this.IsMinimumLocked, maximumSeconds, this.IsMaximumLocked);
if (!this.IsMinimumLocked())
this.MinimumUpdate(range.MinimumSeconds);
if (!this.IsMaximumLocked())
this.MaximumUpdate(range.MaximumSeconds);
if (!this.IsSetting)
return;
this.isStorePending = true;
this.storeTimer.Stop();
this.storeTimer.Start();
}
private async Task StoreAsync()
{
this.isStorePending = false;
await this.SettingsManager.StoreSettings();
await this.InformAboutChange();
}
}
@@ -22,10 +22,9 @@
</MudTooltip>
</MudStack>
<MudPaper Class="pa-3 mb-3 border-dashed border rounded-lg">
<ConfigurationSlider T="int" OptionDescription="@T("Shortest pause between indexing steps")" Min="0" Max="@this.MinimumPauseSliderMax" Step="1" Unit="@T("seconds")" Value="@(() => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MinimumPauseBetweenStepsSeconds)" ValueUpdate="@(value => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MinimumPauseBetweenStepsSeconds = value)" OptionHelp="@TA("AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.")" IsLocked="@(() => IsMinimumPauseLocked)"/>
<ConfigurationSlider T="int" OptionDescription="@T("Longest pause between indexing steps")" Min="@this.MaximumPauseSliderMin" Max="@DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS" Step="1" Unit="@T("seconds")" Value="@(() => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MaximumPauseBetweenStepsSeconds)" ValueUpdate="@(value => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MaximumPauseBetweenStepsSeconds = value)" OptionHelp="@T("The upper end of the random pause between two indexing steps. AI Studio allows up to 300 seconds (5 minutes).")" IsLocked="@(() => IsMaximumPauseLocked)"/>
</MudPaper>
<ConfigurationPauseRange Limits="@DataDataSourceIndexing.PAUSE_LIMITS" OptionDescription="@T("Pause between indexing steps")" OptionHelp="@TA("AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.")"
Minimum="@(() => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MinimumPauseBetweenStepsSeconds)" MinimumUpdate="@(value => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MinimumPauseBetweenStepsSeconds = value)" IsMinimumLocked="@(() => DataDataSourceIndexing.IsMinimumPauseLocked)"
Maximum="@(() => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MaximumPauseBetweenStepsSeconds)" MaximumUpdate="@(value => this.SettingsManager.ConfigurationData.App.DataSourceIndexing.MaximumPauseBetweenStepsSeconds = value)" IsMaximumLocked="@(() => DataDataSourceIndexing.IsMaximumPauseLocked)"/>
@{ var embeddingStatuses = this.DataSourceEmbeddingService.GetStatuses().ToDictionary(status => status.DataSourceId, StringComparer.OrdinalIgnoreCase); }
<MudTable T="IDataSourceBase" Items="@this.ConfiguredDataSources" Hover="@true" Class="border-dashed border rounded-lg">
@@ -5,7 +5,6 @@ using AIStudio.Tools.Databases;
using AIStudio.Tools.ERIClient.DataModel;
using AIStudio.Tools.PluginSystem;
using AIStudio.Tools.Services;
using AIStudio.Tools.Services.Indexing;
using Microsoft.AspNetCore.Components;
@@ -40,27 +39,6 @@ public partial class DataSourceManagement : MSGComponentBase
private bool AreMailboxesEnabled => PreviewFeatures.PRE_MAILBOXES_2026.IsEnabled(this.SettingsManager);
private static bool IsMinimumPauseLocked => ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, out var meta) && meta.IsLocked;
private static bool IsMaximumPauseLocked => ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, out var meta) && meta.IsLocked;
/// <remarks>
/// A slider moves a value which falls out of its range into it. A locked slider therefore keeps
/// the whole range, since its value belongs to the organization. A free one ends at the locked
/// upper bound, and the free value adjusts to it, cf. PauseRange.GetEffective.
/// </remarks>
private int MinimumPauseSliderMax => IsMaximumPauseLocked && !IsMinimumPauseLocked
? PauseRange.FromSettings(this.SettingsManager.ConfigurationData.App.DataSourceIndexing).MaximumSeconds
: DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS;
/// <remarks>
/// The upper bound starts where the lower bound is, so raising the lower one above it raises the
/// upper one along with it. A locked slider keeps the whole range, cf. MinimumPauseSliderMax.
/// </remarks>
private int MaximumPauseSliderMin => IsMaximumPauseLocked
? 0
: PauseRange.FromSettings(this.SettingsManager.ConfigurationData.App.DataSourceIndexing).MinimumSeconds;
#region Overrides of ComponentBase
protected override async Task OnInitializedAsync()
@@ -86,15 +86,9 @@
<ConfigurationDirectory OptionDescription="@T("Default output folder")" Disabled="@this.DefaultsDisabled" DirectoryDialogTitle="@T("Select the default output folder")" Text="@(() => this.SettingsManager.ConfigurationData.BatchProcessing.OutputDirectory)" TextUpdate="@(value => this.SettingsManager.ConfigurationData.BatchProcessing.OutputDirectory = value)" OptionHelp="@T("Leave empty to use the ai-results subfolder of the input folder.")" IsLocked="() => ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.OutputDirectory, out var meta) && meta.IsLocked"/>
<MudText Typo="Typo.h6" Class="mb-3 mt-6">@T("Processing pace")</MudText>
@if (this.MinimumDelayIsManaged)
{
<MudAlert Severity="Severity.Info" Dense="true" Class="mb-6">@(string.Format(TA("Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit."), this.ManagedMinimumDelaySeconds))</MudAlert>
}
else
{
<ConfigurationSlider T="int" OptionDescription="@T("Default minimum pause between files")" Min="@DataBatchProcessing.MIN_DELAY_SECONDS" Max="@DataBatchProcessing.MAX_DELAY_SECONDS" Step="1" Unit="@T("seconds")" Disabled="@this.DefaultsDisabled" Value="@(() => this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds)" ValueUpdate="@(value => this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds = value)" OptionHelp="@T("The lower end of the random pause interval. AI Studio never allows less than 6 seconds.")"/>
}
<ConfigurationSlider T="int" OptionDescription="@T("Default maximum pause between files")" Min="@this.EffectiveMinimumDelaySeconds" Max="@DataBatchProcessing.MAX_DELAY_SECONDS" Step="1" Unit="@T("seconds")" Disabled="@this.DefaultsDisabled" Value="@(() => this.SettingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds)" ValueUpdate="@(value => this.SettingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds = value)" OptionHelp="@T("The upper end of the random pause interval. The app-wide maximum is 300 seconds (5 minutes).")"/>
<ConfigurationPauseRange Limits="@DataBatchProcessing.PAUSE_LIMITS" Disabled="@this.DefaultsDisabled" OptionDescription="@T("Default pause between files")" OptionHelp="@T("Before the next file starts, AI Studio waits for a random time within this range, at least 6 seconds and at most 300 seconds (5 minutes).")"
Minimum="@(() => this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds)" MinimumUpdate="@(value => this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds = value)" IsMinimumLocked="@(() => DataBatchProcessing.IsMinimumPauseLocked)"
Maximum="@(() => this.SettingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds)" MaximumUpdate="@(value => this.SettingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds = value)" IsMaximumLocked="@(() => DataBatchProcessing.IsMaximumPauseLocked)"/>
<MudText Typo="Typo.h6" Class="mb-3 mt-6">@T("AI selection")</MudText>
<ConfigurationMinConfidenceSelection Disabled="@this.DefaultsDisabled" RestrictToGlobalMinimumConfidence="true" SelectedValue="@(() => this.SettingsManager.ConfigurationData.BatchProcessing.MinimumProviderConfidence)" SelectionUpdate="@(value => this.SettingsManager.ConfigurationData.BatchProcessing.MinimumProviderConfidence = value)" IsLocked="() => ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.MinimumProviderConfidence, out var meta) && meta.IsLocked"/>
@@ -1,6 +1,5 @@
using AIStudio.Assistants.BatchProcessing;
using AIStudio.Settings;
using AIStudio.Settings.DataModel;
namespace AIStudio.Dialogs.Settings;
@@ -8,21 +7,6 @@ public partial class SettingsDialogBatchProcessing : SettingsDialogBase
{
private bool DefaultsDisabled() => !this.SettingsManager.ConfigurationData.BatchProcessing.PreselectOptions;
private bool MinimumDelayIsManaged => ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.MinimumDelaySeconds, out var meta)
&& meta.ManagedMode is not null;
private int ManagedMinimumDelaySeconds => Math.Clamp(
this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds,
DataBatchProcessing.MIN_DELAY_SECONDS,
DataBatchProcessing.MAX_DELAY_SECONDS);
private int EffectiveMinimumDelaySeconds => this.MinimumDelayIsManaged
? this.ManagedMinimumDelaySeconds
: Math.Clamp(
this.SettingsManager.ConfigurationData.BatchProcessing.MinimumDelaySeconds,
DataBatchProcessing.MIN_DELAY_SECONDS,
DataBatchProcessing.MAX_DELAY_SECONDS);
private bool FreePromptImportDisabled() => this.DefaultsDisabled()
|| ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.FreePrompt, out var meta) && meta.IsLocked;
@@ -6,7 +6,6 @@ using AIStudio.Provider;
using AIStudio.Settings.DataModel;
using AIStudio.Tools.Rust;
using AIStudio.Tools.Services;
using AIStudio.Tools.Services.Indexing;
using Microsoft.AspNetCore.Components;
@@ -66,7 +65,7 @@ public partial class Embeddings : MSGComponentBase
{
get
{
var pause = PauseRange.FromSettings(this.SettingsManager.ConfigurationData.App.DataSourceIndexing);
var pause = this.SettingsManager.ConfigurationData.App.DataSourceIndexing.EffectivePauseRange;
if (pause.IsNone)
return string.Empty;
@@ -869,10 +869,14 @@ CONFIG["SETTINGS"] = {}
-- CONFIG["SETTINGS"]["DataBatchProcessing.CsvSeparator"] = "SEMICOLON"
-- CONFIG["SETTINGS"]["DataBatchProcessing.CustomCsvSeparator"] = "^"
--
-- Enforce the lower end of the random pause between files for the organization.
-- The value must be between 6 and 300 seconds. Users can configure only the upper
-- end of the interval while this setting is managed by a configuration plugin.
-- Configure the random pause between two files. Before the next file starts, AI Studio waits
-- for a random number of whole seconds between the lower and the upper bound, both included.
-- This spares your AI servers. Both values must be between 6 and 300 seconds; the defaults are
-- 6 and 10 seconds. You may set one bound or both. A bound you set wins, and AI Studio adjusts
-- the other one to it. Should the upper bound be below the lower bound, the lower bound wins.
-- The upper bound requires AI Studio v26.11.2 or newer; older versions ignore it.
-- CONFIG["SETTINGS"]["DataBatchProcessing.MinimumDelaySeconds"] = 12
-- CONFIG["SETTINGS"]["DataBatchProcessing.MaximumDelaySeconds"] = 30
--
-- Configure the minimum provider confidence and the default provider.
-- Allowed confidence values are: NONE, UNTRUSTED, UNKNOWN, VERY_LOW, LOW, MODERATE, MEDIUM, HIGH
@@ -899,6 +903,8 @@ CONFIG["SETTINGS"] = {}
-- CONFIG["SETTINGS"]["DataBatchProcessing.ResultColumnHeader.AllowUserOverride"] = true
-- CONFIG["SETTINGS"]["DataBatchProcessing.CsvSeparator.AllowUserOverride"] = true
-- CONFIG["SETTINGS"]["DataBatchProcessing.CustomCsvSeparator.AllowUserOverride"] = true
-- CONFIG["SETTINGS"]["DataBatchProcessing.MinimumDelaySeconds.AllowUserOverride"] = true
-- CONFIG["SETTINGS"]["DataBatchProcessing.MaximumDelaySeconds.AllowUserOverride"] = true
-- CONFIG["SETTINGS"]["DataBatchProcessing.MinimumProviderConfidence.AllowUserOverride"] = true
-- CONFIG["SETTINGS"]["DataBatchProcessing.PreselectedProvider.AllowUserOverride"] = true
@@ -423,12 +423,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- These tools are part of the selected policy and cannot be changed here. Every tool has to meet the confidence requirements of the selected provider, so a tool may stay unavailable even when the policy permits it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1133257227"] = "Diese Werkzeuge sind Teil des ausgewählten Regelwerks und können hier nicht geändert werden. Jedes Werkzeug muss die Vertrauensanforderungen des ausgewählten Anbieters erfüllen. Daher kann ein Werkzeug weiterhin nicht verfügbar sein, selbst wenn das Regelwerk es zulässt."
-- Your organization requires a pause of at least {0} seconds between files.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1155517317"] = "Ihre Organisation verlangt eine Pause von mindestens {0} Sekunden zwischen den Dateien."
-- Your organization requires a pause of at least {0} seconds between files.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1155517317::INFORMAL"] = "Deine Organisation verlangt eine Pause von mindestens {0} Sekunden zwischen den Dateien."
-- The results table contains one row per document, starting with the file name. Here you can name the column that holds the AI answer, e.g., Summary. When left empty, we use 'Result'.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1164512104"] = "Die Ergebnistabelle enthält eine Zeile pro Dokument, beginnend mit dem Dateinamen. Hier können Sie die Spalte benennen, welche die Antwort der KI enthält, z. B. Zusammenfassung. Wenn Sie das Feld leer lassen, verwenden wir „Ergebnis“."
@@ -510,18 +504,12 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- Waiting {0} seconds before starting the next file.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1708373046"] = "Die nächste Datei startet in {0} Sekunden."
-- seconds
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1723256298"] = "Sekunden"
-- The selected folder does not exist.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T17705912"] = "Der ausgewählte Ordner existiert nicht."
-- The image was no longer available while the model was asked about it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1805791865"] = "Das Bild war nicht mehr verfügbar, während das Modell dazu befragt wurde."
-- Minimum pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1829787634"] = "Mindestpause zwischen Dateien"
-- Was not able to read the input folder: {0}
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1871021621"] = "Der Eingabeordner konnte nicht gelesen werden: {0}"
@@ -669,9 +657,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- The selected model cannot read images, so the {0} images among the selected files will fail. All other files are processed as usual.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T324865195"] = "Das ausgewählte Modell kann keine Bilder lesen, daher schlägt die Verarbeitung der {0} Bilder unter den ausgewählten Dateien fehl. Alle anderen Dateien werden wie gewohnt verarbeitet."
-- Maximum pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T3250003796"] = "Maximale Pause zwischen Dateien"
-- Please select the folder that contains the documents you want to process.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T33077198"] = "Bitte wählen Sie den Ordner aus, der die zu verarbeitenden Dokumente enthält."
@@ -843,6 +828,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- The selected model cannot read images, so the image among the selected files will fail. All other files are processed as usual.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T9738678"] = "Das ausgewählte Modell kann keine Bilder lesen, daher schlägt die Verarbeitung des Bildes unter den ausgewählten Dateien fehl. Alle anderen Dateien werden wie gewohnt verarbeitet."
-- Pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T976137570"] = "Pause zwischen Dateien"
-- Comma (,)
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::BATCHPROCESSINGCSVSEPARATOREXTENSIONS::T1676507543"] = "Komma (,)"
@@ -8754,6 +8742,15 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONMULTISELECT::T95098799"] = "
-- You have selected 1 item.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONMULTISELECT::T95098799::INFORMAL"] = "Du hast 1 Element ausgewählt."
-- No pause
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T1202649384"] = "Keine Pause"
-- {0} seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T2586010064"] = "{0} Sekunden"
-- {0} to {1} seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T4176272400"] = "{0} bis {1} Sekunden"
-- Preselected provider
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPROVIDERSELECTION::T1469984996"] = "Vorausgewählter Anbieter"
@@ -9237,9 +9234,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1084943026::INFORM
-- Automatic local data source refresh
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1208397349"] = "Automatische Aktualisierung lokaler Datenquellen"
-- Shortest pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1308136668"] = "Kürzeste Pause zwischen den Etappen der Indexierung"
-- Refresh
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T135637716"] = "Aktualisieren"
@@ -9261,12 +9255,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1592527757"] = "Di
-- External (ERI)
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1652430727"] = "Extern (ERI)"
-- Longest pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1654263778"] = "Längste Pause zwischen den Etappen der Indexierung"
-- seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1723256298"] = "Sekunden"
-- Delete Data Source
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1849107431"] = "Datenquelle löschen"
@@ -9276,15 +9264,15 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2067030738"] = "M
-- Are you sure you want to delete the mailbox '{0}'? Your mails stay on the server as they are. AI Studio only deletes its index of them and the stored password.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2067030738::INFORMAL"] = "Möchtest du das Postfach „{0}“ wirklich löschen? Deine E-Mails bleiben unverändert auf dem Server. AI Studio löscht lediglich den dazugehörigen Index und das gespeicherte Passwort."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2111903307"] = "AI Studio indexiert große Datenquellen in Etappen von wenigen Minuten. Zwischen zwei Etappen wartet AI Studio eine zufällige Zeit innerhalb dieses Bereichs, höchstens 300 Sekunden (5 Minuten). Das entlastet einen Einbettungsserver, den sich viele Nutzer teilen, zum Beispiel in Ihrer Organisation. Stellen Sie beide Werte auf 0 Sekunden, wenn keine Pause eingelegt werden soll."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2111903307::INFORMAL"] = "AI Studio indexiert große Datenquellen in Etappen von wenigen Minuten. Zwischen zwei Etappen wartet AI Studio eine zufällige Zeit innerhalb dieses Bereichs, höchstens 300 Sekunden (5 Minuten). Das entlastet einen Einbettungsserver, den sich viele Nutzer teilen, zum Beispiel in deiner Organisation. Stell beide Werte auf 0 Sekunden, wenn keine Pause eingelegt werden soll."
-- Local Directory Data Source Information
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2146756020"] = "Informationen zur lokalen Ordner-Datenquelle"
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2352821039"] = "AI Studio indexiert große Datenquellen in Etappen von wenigen Minuten. Zwischen zwei Etappen wartet AI Studio eine zufällige Zeit, die zwischen der kürzesten und der längsten Pause liegt. Das entlastet einen Einbettungsserver, den sich viele Nutzer teilen, zum Beispiel in Ihrer Organisation. Lassen Sie beide Werte auf 0 Sekunden, wenn keine Pause eingelegt werden soll."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2352821039::INFORMAL"] = "AI Studio indexiert große Datenquellen in Etappen von wenigen Minuten. Zwischen zwei Etappen wartet AI Studio eine zufällige Zeit, die zwischen der kürzesten und der längsten Pause liegt. Das entlastet einen Einbettungsserver, den sich viele Nutzer teilen, zum Beispiel in deiner Organisation. Lass beide Werte auf 0 Sekunden, wenn keine Pause eingelegt werden soll."
-- Local data sources refresh when files change, mailboxes every 16 minutes.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2511157475"] = "Lokale Datenquellen werden aktualisiert, wenn sich Dateien ändern, Postfächer alle 16 Minuten."
@@ -9339,9 +9327,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3337072977"] = "M
-- Are you sure you want to delete the data source '{0}' of type '{1}'?
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3337072977::INFORMAL"] = "Möchtest du die Datenquelle „{0}“ vom Typ „{1}“ wirklich löschen?"
-- The upper end of the random pause between two indexing steps. AI Studio allows up to 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3401303590"] = "Das obere Ende der zufälligen Pause zwischen zwei Etappen der Indexierung. AI Studio erlaubt bis zu 300 Sekunden (5 Minuten)."
-- Unknown
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3424652889"] = "Unbekannt"
@@ -9384,6 +9369,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4108252513"] = "Wa
-- Information
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4256323669"] = "Information"
-- Pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4289321676"] = "Pause zwischen den Etappen der Indexierung"
-- Cannot export this ERI data source because no enterprise encryption secret is configured.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T750361472"] = "Diese ERI-Datenquelle kann nicht exportiert werden, da kein Geheimnis für die Verschlüsselung des Unternehmens konfiguriert ist."
@@ -15951,12 +15939,12 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTSPAGE::T786
-- Collapsing a category keeps the assistants page tidy. Choose whether AI Studio keeps offering its assistants elsewhere, e.g., in the "Send to ..." menu.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTSPAGE::T786145170::INFORMAL"] = "Durch das Einklappen einer Kategorie bleibt die Assistentenseite übersichtlich. Leg fest, ob AI Studio ihre Assistenten weiterhin an anderer Stelle anbietet, z. B. im Menü „Senden an …“."
-- Default minimum pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1008440099"] = "Standardmäßige Mindestpause zwischen Dateien"
-- Instructions
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1221801316"] = "Anweisungen"
-- Default pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1294143443"] = "Standardmäßige Pause zwischen Dateien"
-- Include hidden files and folders by default?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1450016875"] = "Versteckte Dateien und Ordner standardmäßig einbeziehen?"
@@ -15969,9 +15957,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T15
-- Hidden are files and folders whose names start with a dot, such as .git or .env, and those hidden by the operating system. A file pattern which starts with a dot, such as .gitignore, selects such files anyway.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1624717965"] = "Als versteckt gelten Dateien und Ordner, deren Namen mit einem Punkt beginnen, z. B. .git oder .env, sowie solche, die das Betriebssystem als versteckt kennzeichnet. Ein Dateimuster, das mit einem Punkt beginnt, z. B. .gitignore, wählt solche Dateien trotzdem aus."
-- seconds
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1723256298"] = "Sekunden"
-- Default prompt
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1750564968"] = "Standard-Prompt"
@@ -16008,9 +15993,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T23
-- Separate multiple file patterns with a semicolon, e.g., *.pdf;*.docx. The standard patterns include all supported audio and video formats as well as images in JPG, PNG, WebP, GIF, BMP, and TIFF format.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T232588799::INFORMAL"] = "Trenne mehrere Dateimuster durch ein Semikolon, z. B. *.pdf;*.docx. Die Standardmuster umfassen alle unterstützten Audio- und Videoformate sowie Bilder im JPG-, PNG-, WebP-, GIF-, BMP- und TIFF-Format."
-- The lower end of the random pause interval. AI Studio never allows less than 6 seconds.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T237774509"] = "Das untere Ende des Intervalls für die zufällige Pause. AI Studio erlaubt niemals weniger als 6 Sekunden."
-- A policy brings its own tools, so there is nothing to preselect here. You configure them with the policy in the Document Analysis Assistant.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T2391906382"] = "Ein Regelwerk bringt seine eigenen Werkzeuge mit, daher gibt es hier nichts vorauszuwählen. Sie konfigurieren die Werkzeuge zusammen mit dem Regelwerk im Assistenten für die Dokumentenanalyse."
@@ -16053,9 +16035,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T29
-- Only the selected folder is processed
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T2958253681"] = "Nur der ausgewählte Ordner wird verarbeitet"
-- Default maximum pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3011459001"] = "Standardmäßige maximale Pause zwischen Dateien"
-- Include subfolders by default?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3106330739"] = "Unterordner standardmäßig einbeziehen?"
@@ -16080,21 +16059,12 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T34
-- Processing pace
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3428873429"] = "Verarbeitungsgeschwindigkeit"
-- The upper end of the random pause interval. The app-wide maximum is 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3434290122"] = "Das obere Ende des zufälligen Pausenintervalls. Der appweite Höchstwert beträgt 300 Sekunden (5 Minuten)."
-- Close
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3448155331"] = "Schließen"
-- The current content of this Markdown file is loaded whenever the defaults are applied.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3468539567"] = "Der aktuelle Inhalt dieser Markdown-Datei wird geladen, wenn die Standardwerte angewendet werden."
-- Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3663516199"] = "Ihre Organisation verlangt eine Pause von mindestens {0} Sekunden zwischen Dateien. Benutzer können nur die Obergrenze festlegen."
-- Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3663516199::INFORMAL"] = "Deine Organisation verlangt eine Pause von mindestens {0} Sekunden zwischen Dateien. Benutzer können nur die Obergrenze festlegen."
-- Load default prompt from file
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3763644960"] = "Standard-Prompt aus Datei laden"
@@ -16149,6 +16119,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T70
-- Restore default patterns
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T7425959"] = "Standardmuster wiederherstellen"
-- Before the next file starts, AI Studio waits for a random time within this range, at least 6 seconds and at most 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T754486332"] = "Bevor die nächste Datei gestartet wird, wartet AI Studio eine zufällige Zeit innerhalb dieses Bereichs, mindestens 6 Sekunden und höchstens 300 Sekunden (5 Minuten)."
-- Leave empty when an input folder should be selected for every batch run.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T762890100"] = "Leer lassen, wenn für jeden Stapellauf ein Eingabeordner ausgewählt werden soll."
@@ -423,12 +423,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- These tools are part of the selected policy and cannot be changed here. Every tool has to meet the confidence requirements of the selected provider, so a tool may stay unavailable even when the policy permits it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1133257227"] = "These tools are part of the selected policy and cannot be changed here. Every tool has to meet the confidence requirements of the selected provider, so a tool may stay unavailable even when the policy permits it."
-- Your organization requires a pause of at least {0} seconds between files.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1155517317"] = "Your organization requires a pause of at least {0} seconds between files."
-- Your organization requires a pause of at least {0} seconds between files.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1155517317::INFORMAL"] = "Your organization requires a pause of at least {0} seconds between files."
-- The results table contains one row per document, starting with the file name. Here you can name the column that holds the AI answer, e.g., Summary. When left empty, we use 'Result'.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1164512104"] = "The results table contains one row per document, starting with the file name. Here you can name the column that holds the AI answer, e.g., Summary. When left empty, we use 'Result'."
@@ -510,18 +504,12 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- Waiting {0} seconds before starting the next file.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1708373046"] = "Waiting {0} seconds before starting the next file."
-- seconds
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1723256298"] = "seconds"
-- The selected folder does not exist.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T17705912"] = "The selected folder does not exist."
-- The image was no longer available while the model was asked about it.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1805791865"] = "The image was no longer available while the model was asked about it."
-- Minimum pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1829787634"] = "Minimum pause between files"
-- Was not able to read the input folder: {0}
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T1871021621"] = "Was not able to read the input folder: {0}"
@@ -669,9 +657,6 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- The selected model cannot read images, so the {0} images among the selected files will fail. All other files are processed as usual.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T324865195"] = "The selected model cannot read images, so the {0} images among the selected files will fail. All other files are processed as usual."
-- Maximum pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T3250003796"] = "Maximum pause between files"
-- Please select the folder that contains the documents you want to process.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T33077198"] = "Please select the folder that contains the documents you want to process."
@@ -843,6 +828,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING
-- The selected model cannot read images, so the image among the selected files will fail. All other files are processed as usual.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T9738678"] = "The selected model cannot read images, so the image among the selected files will fail. All other files are processed as usual."
-- Pause between files
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::ASSISTANTBATCHPROCESSING::T976137570"] = "Pause between files"
-- Comma (,)
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::BATCHPROCESSING::BATCHPROCESSINGCSVSEPARATOREXTENSIONS::T1676507543"] = "Comma (,)"
@@ -8754,6 +8742,15 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONMULTISELECT::T95098799"] = "
-- You have selected 1 item.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONMULTISELECT::T95098799::INFORMAL"] = "You have selected 1 item."
-- No pause
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T1202649384"] = "No pause"
-- {0} seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T2586010064"] = "{0} seconds"
-- {0} to {1} seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPAUSERANGE::T4176272400"] = "{0} to {1} seconds"
-- Preselected provider
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::CONFIGURATIONPROVIDERSELECTION::T1469984996"] = "Preselected provider"
@@ -9237,9 +9234,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1084943026::INFORM
-- Automatic local data source refresh
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1208397349"] = "Automatic local data source refresh"
-- Shortest pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1308136668"] = "Shortest pause between indexing steps"
-- Refresh
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T135637716"] = "Refresh"
@@ -9261,12 +9255,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1592527757"] = "Ca
-- External (ERI)
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1652430727"] = "External (ERI)"
-- Longest pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1654263778"] = "Longest pause between indexing steps"
-- seconds
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1723256298"] = "seconds"
-- Delete Data Source
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T1849107431"] = "Delete Data Source"
@@ -9276,15 +9264,15 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2067030738"] = "Ar
-- Are you sure you want to delete the mailbox '{0}'? Your mails stay on the server as they are. AI Studio only deletes its index of them and the stored password.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2067030738::INFORMAL"] = "Are you sure you want to delete the mailbox '{0}'? Your mails stay on the server as they are. AI Studio only deletes its index of them and the stored password."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2111903307"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2111903307::INFORMAL"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time within this range, at most 300 seconds (5 minutes). This spares an embedding server which many people share, for example in your organization. Move both ends to 0 seconds for no pause."
-- Local Directory Data Source Information
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2146756020"] = "Local Directory Data Source Information"
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2352821039"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause."
-- AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2352821039::INFORMAL"] = "AI Studio indexes large data sources in steps of a few minutes. Between two steps, it waits for a random time between the shortest and the longest pause. This spares an embedding server which many people share, for example in your organization. Leave both at 0 seconds for no pause."
-- Local data sources refresh when files change, mailboxes every 16 minutes.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T2511157475"] = "Local data sources refresh when files change, mailboxes every 16 minutes."
@@ -9339,9 +9327,6 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3337072977"] = "Ar
-- Are you sure you want to delete the data source '{0}' of type '{1}'?
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3337072977::INFORMAL"] = "Are you sure you want to delete the data source '{0}' of type '{1}'?"
-- The upper end of the random pause between two indexing steps. AI Studio allows up to 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3401303590"] = "The upper end of the random pause between two indexing steps. AI Studio allows up to 300 seconds (5 minutes)."
-- Unknown
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T3424652889"] = "Unknown"
@@ -9384,6 +9369,9 @@ UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4108252513"] = "Wa
-- Information
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4256323669"] = "Information"
-- Pause between indexing steps
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T4289321676"] = "Pause between indexing steps"
-- Cannot export this ERI data source because no enterprise encryption secret is configured.
UI_TEXT_CONTENT["AISTUDIO::COMPONENTS::DATASOURCEMANAGEMENT::T750361472"] = "Cannot export this ERI data source because no enterprise encryption secret is configured."
@@ -15951,12 +15939,12 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTSPAGE::T786
-- Collapsing a category keeps the assistants page tidy. Choose whether AI Studio keeps offering its assistants elsewhere, e.g., in the "Send to ..." menu.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGASSISTANTSPAGE::T786145170::INFORMAL"] = "Collapsing a category keeps the assistants page tidy. Choose whether AI Studio keeps offering its assistants elsewhere, e.g., in the \"Send to ...\" menu."
-- Default minimum pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1008440099"] = "Default minimum pause between files"
-- Instructions
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1221801316"] = "Instructions"
-- Default pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1294143443"] = "Default pause between files"
-- Include hidden files and folders by default?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1450016875"] = "Include hidden files and folders by default?"
@@ -15969,9 +15957,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T15
-- Hidden are files and folders whose names start with a dot, such as .git or .env, and those hidden by the operating system. A file pattern which starts with a dot, such as .gitignore, selects such files anyway.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1624717965"] = "Hidden are files and folders whose names start with a dot, such as .git or .env, and those hidden by the operating system. A file pattern which starts with a dot, such as .gitignore, selects such files anyway."
-- seconds
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1723256298"] = "seconds"
-- Default prompt
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T1750564968"] = "Default prompt"
@@ -16008,9 +15993,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T23
-- Separate multiple file patterns with a semicolon, e.g., *.pdf;*.docx. The standard patterns include all supported audio and video formats as well as images in JPG, PNG, WebP, GIF, BMP, and TIFF format.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T232588799::INFORMAL"] = "Separate multiple file patterns with a semicolon, e.g., *.pdf;*.docx. The standard patterns include all supported audio and video formats as well as images in JPG, PNG, WebP, GIF, BMP, and TIFF format."
-- The lower end of the random pause interval. AI Studio never allows less than 6 seconds.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T237774509"] = "The lower end of the random pause interval. AI Studio never allows less than 6 seconds."
-- A policy brings its own tools, so there is nothing to preselect here. You configure them with the policy in the Document Analysis Assistant.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T2391906382"] = "A policy brings its own tools, so there is nothing to preselect here. You configure them with the policy in the Document Analysis Assistant."
@@ -16053,9 +16035,6 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T29
-- Only the selected folder is processed
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T2958253681"] = "Only the selected folder is processed"
-- Default maximum pause between files
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3011459001"] = "Default maximum pause between files"
-- Include subfolders by default?
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3106330739"] = "Include subfolders by default?"
@@ -16080,21 +16059,12 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T34
-- Processing pace
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3428873429"] = "Processing pace"
-- The upper end of the random pause interval. The app-wide maximum is 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3434290122"] = "The upper end of the random pause interval. The app-wide maximum is 300 seconds (5 minutes)."
-- Close
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3448155331"] = "Close"
-- The current content of this Markdown file is loaded whenever the defaults are applied.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3468539567"] = "The current content of this Markdown file is loaded whenever the defaults are applied."
-- Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3663516199"] = "Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit."
-- Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3663516199::INFORMAL"] = "Your organization requires a pause of at least {0} seconds between files. Users can configure only the upper limit."
-- Load default prompt from file
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T3763644960"] = "Load default prompt from file"
@@ -16149,6 +16119,9 @@ UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T70
-- Restore default patterns
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T7425959"] = "Restore default patterns"
-- Before the next file starts, AI Studio waits for a random time within this range, at least 6 seconds and at most 300 seconds (5 minutes).
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T754486332"] = "Before the next file starts, AI Studio waits for a random time within this range, at least 6 seconds and at most 300 seconds (5 minutes)."
-- Leave empty when an input folder should be selected for every batch run.
UI_TEXT_CONTENT["AISTUDIO::DIALOGS::SETTINGS::SETTINGSDIALOGBATCHPROCESSING::T762890100"] = "Leave empty when an input folder should be selected for every batch run."
@@ -2,6 +2,7 @@ using System.Linq.Expressions;
using AIStudio.Assistants.BatchProcessing;
using AIStudio.Provider;
using AIStudio.Tools.Pauses;
namespace AIStudio.Settings.DataModel;
@@ -12,8 +13,12 @@ namespace AIStudio.Settings.DataModel;
public sealed class DataBatchProcessing(Expression<Func<Data, DataBatchProcessing>>? configSelection = null)
{
public const string DEFAULT_FILE_PATTERNS = "*.pdf;*.docx;*.pptx;*.xlsx;*.md;*.txt;*.jpg;*.jpeg;*.png;*.webp;*.gif;*.bmp;*.tif;*.tiff;*.mp3;*.wav;*.wave;*.aac;*.flac;*.ogg;*.opus;*.m4a;*.m4b;*.wma;*.alac;*.aif;*.aiff;*.caf;*.mp4;*.m4v;*.avi;*.mkv;*.mov;*.wmv;*.flv;*.webm";
public const int MIN_DELAY_SECONDS = 6;
public const int MAX_DELAY_SECONDS = 300;
/// <summary>
/// The pauses between two files either bound may ask for: at least 6 seconds, at most 300 seconds.
/// </summary>
public static readonly PauseLimits PAUSE_LIMITS = new(6, 300);
public const int DEFAULT_MIN_DELAY_SECONDS = 6;
public const int DEFAULT_MAX_DELAY_SECONDS = 10;
public const bool DEFAULT_INCLUDE_SUBDIRECTORIES = false;
@@ -82,7 +87,7 @@ public sealed class DataBatchProcessing(Expression<Func<Data, DataBatchProcessin
public int MinimumDelaySeconds { get; set; } = ManagedConfiguration.Register(configSelection, value => value.MinimumDelaySeconds, DEFAULT_MIN_DELAY_SECONDS);
public int MaximumDelaySeconds { get; set; } = DEFAULT_MAX_DELAY_SECONDS;
public int MaximumDelaySeconds { get; set; } = ManagedConfiguration.Register(configSelection, value => value.MaximumDelaySeconds, DEFAULT_MAX_DELAY_SECONDS);
public ConfidenceLevel MinimumProviderConfidence { get; set; } = ManagedConfiguration.Register(configSelection, value => value.MinimumProviderConfidence, ConfidenceLevel.NONE);
@@ -0,0 +1,18 @@
namespace AIStudio.Settings.DataModel;
public static class DataBatchProcessingExtensions
{
/// <param name="settings">The settings of the Batch Processing Assistant.</param>
extension(DataBatchProcessing settings)
{
/// <summary>
/// Whether a configuration plugin locks the lower bound of the pause between two files.
/// </summary>
public static bool IsMinimumPauseLocked => ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.MinimumDelaySeconds, out var meta) && meta.IsLocked;
/// <summary>
/// Whether a configuration plugin locks the upper bound of the pause between two files.
/// </summary>
public static bool IsMaximumPauseLocked => ManagedConfiguration.TryGet(x => x.BatchProcessing, x => x.MaximumDelaySeconds, out var meta) && meta.IsLocked;
}
}
@@ -1,5 +1,7 @@
using System.Linq.Expressions;
using AIStudio.Tools.Pauses;
namespace AIStudio.Settings.DataModel;
/// <summary>
@@ -9,9 +11,9 @@ namespace AIStudio.Settings.DataModel;
public sealed class DataDataSourceIndexing(Expression<Func<Data, DataDataSourceIndexing>>? configSelection = null)
{
/// <summary>
/// The longest pause between two indexing steps either bound may ask for.
/// The pauses between two indexing steps either bound may ask for: none at all, up to 300 seconds.
/// </summary>
public const int MAX_PAUSE_BETWEEN_STEPS_SECONDS = 300;
public static readonly PauseLimits PAUSE_LIMITS = new(0, 300);
/// <summary>
/// Initializes an unmanaged instance, e.g., for the JSON deserializer.
@@ -0,0 +1,31 @@
using AIStudio.Tools.Pauses;
namespace AIStudio.Settings.DataModel;
public static class DataDataSourceIndexingExtensions
{
/// <param name="settings">The settings of the indexing.</param>
extension(DataDataSourceIndexing settings)
{
/// <summary>
/// Whether a configuration plugin locks the lower bound of the pause between two indexing steps.
/// </summary>
public static bool IsMinimumPauseLocked => ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, out var meta) && meta.IsLocked;
/// <summary>
/// Whether a configuration plugin locks the upper bound of the pause between two indexing steps.
/// </summary>
public static bool IsMaximumPauseLocked => ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, out var meta) && meta.IsLocked;
/// <summary>
/// The bounds of the pause between two indexing steps which apply now, as the user set them
/// and as configuration plugins lock them, cf. PauseRange.GetEffective.
/// </summary>
public PauseRange EffectivePauseRange => PauseRange.GetEffective(
DataDataSourceIndexing.PAUSE_LIMITS,
settings.MinimumPauseBetweenStepsSeconds,
() => DataDataSourceIndexing.IsMinimumPauseLocked,
settings.MaximumPauseBetweenStepsSeconds,
() => DataDataSourceIndexing.IsMaximumPauseLocked);
}
}
@@ -1,7 +1,7 @@
namespace AIStudio.Tools.Services.Indexing;
namespace AIStudio.Tools.Pauses;
/// <summary>
/// How long the indexing step which is about to start waits, cf. PauseBetweenSteps.GetPauseBeforeNextStep.
/// How long the step which is about to start waits, cf. PauseBetweenSteps.GetPauseBeforeNextStep.
/// </summary>
/// <param name="Pause">The pause drawn for the gap since the last step.</param>
/// <param name="Remaining">What is left of the pause now. More than zero, unless this is NONE.</param>
@@ -1,24 +1,24 @@
namespace AIStudio.Tools.Services.Indexing;
namespace AIStudio.Tools.Pauses;
/// <summary>
/// The pause between two indexing steps, which spares an embedding server that many people share.
/// The pause between two steps, e.g., two indexing steps, which spares a server that many people share.
/// </summary>
/// <remarks>
/// Not to be confused with the pauses of the indexing as a whole, e.g., while a backup copies the
/// indexes, cf. IndexingPauses.<br/><br/>
///
/// The pause is a gap between the end of one step and the start of the next, whichever data source
/// either of them belongs to: it is about the load on the embedding server, not about the order of
/// the data sources. Only a step which worked on documents opens a gap. Its pause is drawn once the
/// next step is about to start, from the bounds which apply then, and the time which passed in the
/// meantime counts toward it. When no step comes, nothing is drawn.
/// The pause is a gap between the end of one step and the start of the next, whatever either of
/// them works on: it is about the load on the server, not about the order of the work, e.g., of the
/// data sources of the indexing. Only a step which caused load opens a gap. Its pause is drawn once
/// the next step is about to start, from the bounds which apply then, and the time which passed in
/// the meantime counts toward it. When no step comes, nothing is drawn.
/// </remarks>
internal sealed class PauseBetweenSteps
{
private readonly Lock stateLock = new();
/// <summary>
/// When the last step which worked on documents ended. Null before the first one.
/// When the last step which caused load ended. Null before the first one.
/// </summary>
private DateTimeOffset? lastStepEndedUtc;
@@ -28,7 +28,7 @@ internal sealed class PauseBetweenSteps
private TimeSpan? drawnPause;
/// <summary>
/// Notes that a step which worked on documents ended, which opens a new gap.
/// Notes that a step which caused load ended, e.g., one which worked on documents, which opens a new gap.
/// </summary>
/// <param name="nowUtc">The current time, passed in so the pause can be tested.</param>
public void RecordStepEnded(DateTimeOffset nowUtc)
@@ -0,0 +1,27 @@
namespace AIStudio.Tools.Pauses;
/// <summary>
/// The shortest and the longest pause a feature allows for either bound of its random pause, cf. PauseRange.
/// </summary>
/// <remarks>
/// Each feature sets its own limits next to its settings: the indexing allows no pause at all, for
/// example, while the batch processing always pauses for a few seconds.
/// </remarks>
/// <param name="ShortestSeconds">The shortest pause either bound may ask for.</param>
/// <param name="LongestSeconds">The longest pause either bound may ask for.</param>
public sealed record PauseLimits(int ShortestSeconds, int LongestSeconds)
{
/// <summary>
/// Whether a bound lies within the limits, e.g., one which a configuration plugin sets.
/// </summary>
/// <param name="seconds">The bound.</param>
/// <returns>True when the feature allows the bound.</returns>
public bool Allows(int seconds) => seconds >= this.ShortestSeconds && seconds <= this.LongestSeconds;
/// <summary>
/// Moves a bound into the limits.
/// </summary>
/// <param name="seconds">The bound.</param>
/// <returns>The bound, or the limit it went beyond.</returns>
public int Clamp(int seconds) => Math.Clamp(seconds, this.ShortestSeconds, this.LongestSeconds);
}
@@ -0,0 +1,50 @@
namespace AIStudio.Tools.Pauses;
/// <summary>
/// The bounds of a random pause, e.g., between two indexing steps, cf. PauseBetweenSteps.
/// </summary>
/// <param name="MinimumSeconds">The shortest pause. Between the shortest limit of the feature and MaximumSeconds.</param>
/// <param name="MaximumSeconds">The longest pause, which may be drawn as well. At most the longest limit of the feature.</param>
public sealed record PauseRange(int MinimumSeconds, int MaximumSeconds)
{
/// <summary>
/// No pause at all, which is the default of the indexing.
/// </summary>
public static readonly PauseRange NONE = new(0, 0);
/// <summary>
/// Whether the next step starts right away.
/// </summary>
public bool IsNone => this.MaximumSeconds is 0;
/// <summary>
/// Works out the bounds which apply, so that the lower one never exceeds the upper one.
/// </summary>
/// <remarks>
/// Both bounds are moved into the limits of the feature first. A bound which a configuration plugin
/// locks wins, and the other one adjusts to it. A bound the plugin only presets counts like one the
/// user set. Otherwise, the lower bound wins, i.e., the longer pause: it spares the server, which
/// is what the pause is for. That holds as well when a plugin locks both bounds the wrong way round.<br/><br/>
///
/// Which bound is locked matters only while the bounds are the wrong way round. Asking reads the
/// managed state of the whole app, which bounds in order do without, so the locks are asked only then.
/// </remarks>
/// <param name="limits">The shortest and the longest pause the feature allows.</param>
/// <param name="minimumSeconds">The lower bound as set.</param>
/// <param name="isMinimumLocked">Whether a configuration plugin locks the lower bound.</param>
/// <param name="maximumSeconds">The upper bound as set.</param>
/// <param name="isMaximumLocked">Whether a configuration plugin locks the upper bound.</param>
/// <returns>The bounds which apply.</returns>
public static PauseRange GetEffective(PauseLimits limits, int minimumSeconds, Func<bool> isMinimumLocked, int maximumSeconds, Func<bool> isMaximumLocked)
{
var minimum = limits.Clamp(minimumSeconds);
var maximum = limits.Clamp(maximumSeconds);
if (minimum <= maximum)
return new(minimum, maximum);
if (isMaximumLocked() && !isMinimumLocked())
return new(maximum, maximum);
return new(minimum, minimum);
}
}
@@ -398,13 +398,13 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
ManagedConfiguration.TryProcessConfiguration(x => x.MailboxSettings, x => x.AllowOnlyOrganizationMailServers, this.Id, settingsTable, dryRun);
// Config: the random pause between two indexing steps of local data sources
var minimumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: value => value is >= 0 and <= DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
var minimumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: DataDataSourceIndexing.PAUSE_LIMITS.Allows);
if (!minimumPauseIsValid && settingsTable.TryGetValue("DataDataSourceIndexing.MinimumPauseBetweenStepsSeconds", out _))
LOG.LogWarning("The lower bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between 0 and {MaximumPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
LOG.LogWarning("The lower bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between {ShortestPauseSeconds} and {LongestPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.PAUSE_LIMITS.ShortestSeconds, DataDataSourceIndexing.PAUSE_LIMITS.LongestSeconds);
var maximumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: value => value is >= 0 and <= DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
var maximumPauseIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, this.Id, settingsTable, dryRun, validator: DataDataSourceIndexing.PAUSE_LIMITS.Allows);
if (!maximumPauseIsValid && settingsTable.TryGetValue("DataDataSourceIndexing.MaximumPauseBetweenStepsSeconds", out _))
LOG.LogWarning("The upper bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between 0 and {MaximumPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
LOG.LogWarning("The upper bound of the pause between indexing steps configured by plugin {ConfigPluginId} must be between {ShortestPauseSeconds} and {LongestPauseSeconds} seconds.", this.Id, DataDataSourceIndexing.PAUSE_LIMITS.ShortestSeconds, DataDataSourceIndexing.PAUSE_LIMITS.LongestSeconds);
if (minimumPauseIsValid && maximumPauseIsValid
&& settingsTable.TryGetValue("DataDataSourceIndexing.MinimumPauseBetweenStepsSeconds", out var minimumPauseValue) && minimumPauseValue.TryRead<int>(out var minimumPauseSeconds)
@@ -519,9 +519,20 @@ public sealed class PluginConfiguration(bool isInternal, LuaState state, PluginT
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.CsvSeparator, this.Id, settingsTable, dryRun);
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.CustomCsvSeparator, this.Id, settingsTable, dryRun);
var minimumDelayIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MinimumDelaySeconds, this.Id, settingsTable, dryRun, validator: value => value is >= DataBatchProcessing.MIN_DELAY_SECONDS and <= DataBatchProcessing.MAX_DELAY_SECONDS);
// Config: the random pause between two files of the Batch Processing Assistant
var minimumDelayIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MinimumDelaySeconds, this.Id, settingsTable, dryRun, validator: DataBatchProcessing.PAUSE_LIMITS.Allows);
if (!minimumDelayIsValid && settingsTable.TryGetValue("DataBatchProcessing.MinimumDelaySeconds", out _))
LOG.LogWarning("The Batch Processing minimum delay configured by plugin {ConfigPluginId} must be between {MinimumDelaySeconds} and {MaximumDelaySeconds} seconds.", this.Id, DataBatchProcessing.MIN_DELAY_SECONDS, DataBatchProcessing.MAX_DELAY_SECONDS);
LOG.LogWarning("The Batch Processing minimum delay configured by plugin {ConfigPluginId} must be between {MinimumDelaySeconds} and {MaximumDelaySeconds} seconds.", this.Id, DataBatchProcessing.PAUSE_LIMITS.ShortestSeconds, DataBatchProcessing.PAUSE_LIMITS.LongestSeconds);
var maximumDelayIsValid = ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MaximumDelaySeconds, this.Id, settingsTable, dryRun, validator: DataBatchProcessing.PAUSE_LIMITS.Allows);
if (!maximumDelayIsValid && settingsTable.TryGetValue("DataBatchProcessing.MaximumDelaySeconds", out _))
LOG.LogWarning("The Batch Processing maximum delay configured by plugin {ConfigPluginId} must be between {MinimumDelaySeconds} and {MaximumDelaySeconds} seconds.", this.Id, DataBatchProcessing.PAUSE_LIMITS.ShortestSeconds, DataBatchProcessing.PAUSE_LIMITS.LongestSeconds);
if (minimumDelayIsValid && maximumDelayIsValid
&& settingsTable.TryGetValue("DataBatchProcessing.MinimumDelaySeconds", out var minimumDelayValue) && minimumDelayValue.TryRead<int>(out var minimumDelaySeconds)
&& settingsTable.TryGetValue("DataBatchProcessing.MaximumDelaySeconds", out var maximumDelayValue) && maximumDelayValue.TryRead<int>(out var maximumDelaySeconds)
&& maximumDelaySeconds < minimumDelaySeconds)
LOG.LogWarning("The Batch Processing maximum delay configured by plugin {ConfigPluginId} is below its minimum delay. The minimum delay of {MinimumDelaySeconds} seconds wins.", this.Id, minimumDelaySeconds);
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.MinimumProviderConfidence, this.Id, settingsTable, dryRun);
ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, x => x.PreselectedProvider, Guid.Empty, this.Id, settingsTable, dryRun);
@@ -8,6 +8,7 @@ using AIStudio.Tools.Databases;
using AIStudio.Tools.Databases.IndexStore;
using AIStudio.Tools.Databases.VectorStore;
using AIStudio.Tools.Media;
using AIStudio.Tools.Pauses;
using AIStudio.Tools.PluginSystem;
using AIStudio.Tools.Security;
using AIStudio.Tools.Services.Indexing;
@@ -768,7 +769,7 @@ public sealed partial class DataSourceEmbeddingService(SettingsManager settingsM
/// <param name="token">The token of the run.</param>
private async Task WaitForPauseBetweenStepsAsync(IIndexedDataSource dataSource, DataSourceEmbeddingRefreshMode refreshMode, CancellationToken token)
{
var range = PauseRange.FromSettings(settingsManager.ConfigurationData.App.DataSourceIndexing);
var range = settingsManager.ConfigurationData.App.DataSourceIndexing.EffectivePauseRange;
var pause = this.pauseBetweenSteps.GetPauseBeforeNextStep(DateTimeOffset.UtcNow, range, rng);
if (pause.Remaining <= TimeSpan.Zero)
return;
@@ -41,9 +41,11 @@ The parts:
`MORE_TO_DO` gets its next step in the back lane of `DataSourceRunQueue`, behind every data source which begins
a pass, so a mailbox waits for one step at most.
- **`PauseBetweenSteps`** - a gap after every step which worked on documents, so that many people can share one
embedding server. The next run, of whichever data source, waits for a random pause between the bounds of the
settings (`PauseRange`: 0 to 300 seconds, none by default), less the time which passed since the step ended.
Not to be confused with the pause of the indexing as a whole (`IndexingPauses`), which a backup takes.
embedding server. The next run, of whichever data source, waits for a random pause between the bounds which
apply (`DataDataSourceIndexing.EffectivePauseRange` within `PAUSE_LIMITS`: 0 to 300 seconds, none by default),
less the time which passed since the step ended. The pause lives in `Tools/Pauses/` and is shared with other
features, so keep everything about the indexing out of it. Not to be confused with the pause of the indexing
as a whole (`IndexingPauses`), which a backup takes.
- **`IndexingPass`** - the steps of one data source, from its first step until one of them is done. It remembers
which documents failed during an earlier step, so the next steps do not read them again, and which failures
were reported to the user already.
@@ -1,68 +0,0 @@
using AIStudio.Settings;
using AIStudio.Settings.DataModel;
namespace AIStudio.Tools.Services.Indexing;
/// <summary>
/// The bounds of the random pause between two indexing steps, cf. PauseBetweenSteps.
/// </summary>
/// <param name="MinimumSeconds">The shortest pause. Between zero and MaximumSeconds.</param>
/// <param name="MaximumSeconds">The longest pause, which may be drawn as well. At most DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS.</param>
internal sealed record PauseRange(int MinimumSeconds, int MaximumSeconds)
{
/// <summary>
/// No pause at all, which is the default.
/// </summary>
public static readonly PauseRange NONE = new(0, 0);
/// <summary>
/// Whether the next step starts right away.
/// </summary>
public bool IsNone => this.MaximumSeconds is 0;
/// <summary>
/// The bounds which apply now, as the user set them and as configuration plugins lock them.
/// </summary>
/// <param name="settings">The settings of the indexing.</param>
/// <returns>The bounds which apply.</returns>
public static PauseRange FromSettings(DataDataSourceIndexing settings)
{
var minimumSeconds = settings.MinimumPauseBetweenStepsSeconds;
var maximumSeconds = settings.MaximumPauseBetweenStepsSeconds;
//
// Which bound a configuration plugin locks matters only while the bounds are the wrong way
// round. Asking reads the managed state of the whole app, which bounds in order do without:
//
if (minimumSeconds <= maximumSeconds)
return GetEffective(minimumSeconds, false, maximumSeconds, false);
var isMinimumLocked = ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MinimumPauseBetweenStepsSeconds, out var minimumMeta) && minimumMeta.IsLocked;
var isMaximumLocked = ManagedConfiguration.TryGet(x => x.App.DataSourceIndexing, x => x.MaximumPauseBetweenStepsSeconds, out var maximumMeta) && maximumMeta.IsLocked;
return GetEffective(minimumSeconds, isMinimumLocked, maximumSeconds, isMaximumLocked);
}
/// <summary>
/// Works out the bounds which apply, so that the lower one never exceeds the upper one.
/// </summary>
/// <remarks>
/// A bound which a configuration plugin locks wins, and the other one adjusts to it. A bound the
/// plugin only presets counts like one the user set. Otherwise, the lower bound wins, i.e., the
/// longer pause: it spares the embedding server, which is what the pause is for. That holds as
/// well when a plugin locks both bounds the wrong way round.
/// </remarks>
/// <param name="minimumSeconds">The lower bound as set.</param>
/// <param name="isMinimumLocked">Whether a configuration plugin locks the lower bound.</param>
/// <param name="maximumSeconds">The upper bound as set.</param>
/// <param name="isMaximumLocked">Whether a configuration plugin locks the upper bound.</param>
/// <returns>The bounds which apply.</returns>
public static PauseRange GetEffective(int minimumSeconds, bool isMinimumLocked, int maximumSeconds, bool isMaximumLocked)
{
var minimum = Math.Clamp(minimumSeconds, 0, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
var maximum = Math.Clamp(maximumSeconds, 0, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS);
if (isMaximumLocked && !isMinimumLocked)
return new(Math.Min(minimum, maximum), maximum);
return new(minimum, Math.Max(minimum, maximum));
}
}
@@ -10,6 +10,7 @@
- Added the minimum confidence of the provider for each AI task, such as the data source selection or the security audit of assistant plugins, to configuration plugins, so that organizations can preset or lock it.
- Added the settings of the text content cleaner to configuration plugins, so that organizations can preset or lock which model cleans web content.
- Added the password encoding to the mail servers which organizations offer through configuration plugins. Depending on its configuration, a mail server may expect usernames and passwords with characters beyond ASCII in another encoding than UTF-8. With this setting, every mailbox on such a server signs in with the encoding your organization names.
- Added the maximum pause between files of the Batch Processing Assistant to configuration plugins, so that organizations can preset or lock it, like the minimum pause.
- Improved how well the AI remembers what it looked up in a chat: for its earlier answers, it now knows which web pages it read, which searches it ran, and which sources it used. When you ask a follow-up question, it can read the page again instead of claiming that it never read it.
- Improved follow-up questions about web pages which a tool found, such as the results of a web search: the Read Web Page tool may read these pages again later in the same chat, also after you restart AI Studio and also when it may otherwise read only addresses which stand in the chat.
- Improved the texts of AI Studio: we corrected grammar mistakes, missing words, and punctuation in many English texts and improved the wording of some German ones. A few texts which every language showed in English are now translated as well.
@@ -35,6 +36,7 @@
- Improved the messages about failed requests to ERI servers, which no longer repeat the values sent along with a request.
- Improved the Flatpak version of AI Studio for Linux: it now runs on the GNOME 51 runtime, ships the same up-to-date version of .NET, and is built with the same up-to-date version of Rust as all other versions of AI Studio.
- Improved the Mathematics prototype: it takes more limits correctly, answers more equations within its time limit, and finds all solutions of equations with infinitely many, such as sin(x) = 1/2. The AI still gets a single value as well, such as the years in which a sum doubles.
- Improved the pauses between indexing steps of local data sources and between files of the Batch Processing Assistant: a single slider with two handles now sets the shortest and the longest pause, in steps of 5 seconds. In the Batch Processing Assistant, a pause which your organization locks now shows a lock, like all other settings your organization manages, and a pause which your organization only presets is yours to change.
- Changed the icons of AI Studio to Lucide, an open-source icon set. All icons now share one style, and each feature shows the same icon wherever you meet it.
- Changed the names of the settings of the AI tasks in configuration plugins, which no longer speak of agents: `DataAgentDataSourceSelection` is now `DataDataSourceSelection`, `DataAgentRetrievalContextValidation` is now `DataRetrievalContextValidation`, `PreselectAgentOptions` is now `PreselectOptions`, and `PreselectedAgentProvider` is now `PreselectedProvider`. AI Studio still reads the names of v26.11.1 at least until May 2027 and names the new one in its log. Until every computer in your organization runs this version, set both names, since older versions know only the former ones.
- Changed how requests to self-hosted servers name the AI tasks, when your organization lets these requests name the feature which sent them: the User-Agent now says `Component/AI_TASK_…` instead of `Component/AGENT_…`, e.g., `Component/AI_TASK_DATA_SOURCE_SELECTION`. If you filter the logs of your servers by these names, adjust your filters.
@@ -0,0 +1,124 @@
using System.Linq.Expressions;
using AIStudio.Settings;
using AIStudio.Settings.DataModel;
using Lua;
using Lua.Standard;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging.Abstractions;
namespace AIStudio.Tests.Settings;
/// <summary>
/// Checks how a configuration plugin sets the bounds of the pause between two files of the Batch
/// Processing Assistant.
/// </summary>
/// <remarks>
/// The settings are reached through Program.SERVICE_PROVIDER, as in the app, because a managed setting
/// writes its value and its lock there. The plugin passes the check of PluginConfiguration.
/// </remarks>
[TestFixture]
public sealed class BatchProcessingPauseTests
{
private static readonly Guid PLUGIN_ID = Guid.Parse("5c1e8f27-94ad-4b36-a0f2-7d3b6e91c4a8");
private SettingsManager settingsManager = null!;
private ServiceProvider serviceProvider = null!;
private IServiceProvider previousServiceProvider = null!;
[SetUp]
public void CreateSettings()
{
// Creating the settings data registers every managed setting:
this.settingsManager = new SettingsManager(NullLogger<SettingsManager>.Instance, null!);
this.previousServiceProvider = Program.SERVICE_PROVIDER;
this.serviceProvider = new ServiceCollection().AddSingleton(this.settingsManager).BuildServiceProvider();
Program.SERVICE_PROVIDER = this.serviceProvider;
}
[TearDown]
public void RestoreApplicationState()
{
// The managed state of a setting outlives this fixture, so we release what the plugin took over:
ManagedConfiguration.CleanupLeftOverManagedConfigurations([], new HashSet<Guid>());
Program.SERVICE_PROVIDER = this.previousServiceProvider;
this.serviceProvider.Dispose();
}
[Test]
public async Task APluginLocksTheUpperBound()
{
var processed = await ProcessAsync(x => x.MaximumDelaySeconds, """SETTINGS["DataBatchProcessing.MaximumDelaySeconds"] = 30""");
using (Assert.EnterMultipleScope())
{
Assert.That(processed, Is.True);
Assert.That(this.settingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds, Is.EqualTo(30));
Assert.That(DataBatchProcessing.IsMaximumPauseLocked, Is.True);
Assert.That(DataBatchProcessing.IsMinimumPauseLocked, Is.False);
}
}
[TestCase(5, TestName = "An upper bound below 6 seconds is rejected")]
[TestCase(301, TestName = "An upper bound above 300 seconds is rejected")]
public async Task AnUpperBoundOutsideTheLimitsIsRejected(int configuredSeconds)
{
this.settingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds = 20;
var processed = await ProcessAsync(x => x.MaximumDelaySeconds, $"""SETTINGS["DataBatchProcessing.MaximumDelaySeconds"] = {configuredSeconds}""");
using (Assert.EnterMultipleScope())
{
Assert.That(processed, Is.False);
Assert.That(this.settingsManager.ConfigurationData.BatchProcessing.MaximumDelaySeconds, Is.EqualTo(20), "A rejected value leaves the choice of the user untouched.");
Assert.That(DataBatchProcessing.IsMaximumPauseLocked, Is.False, "A rejected value locks nothing.");
}
}
[Test]
public async Task ABoundWhichUsersMayChangeIsNoLock()
{
const string SETTINGS = """
SETTINGS["DataBatchProcessing.MinimumDelaySeconds"] = 12
SETTINGS["DataBatchProcessing.MinimumDelaySeconds.AllowUserOverride"] = true
SETTINGS["DataBatchProcessing.MaximumDelaySeconds"] = 30
SETTINGS["DataBatchProcessing.MaximumDelaySeconds.AllowUserOverride"] = true
""";
var minimumProcessed = await ProcessAsync(x => x.MinimumDelaySeconds, SETTINGS);
var maximumProcessed = await ProcessAsync(x => x.MaximumDelaySeconds, SETTINGS);
using (Assert.EnterMultipleScope())
{
Assert.That(minimumProcessed, Is.True);
Assert.That(maximumProcessed, Is.True);
Assert.That(DataBatchProcessing.IsMinimumPauseLocked, Is.False, "Users may change a lower bound which the organization only presets.");
Assert.That(DataBatchProcessing.IsMaximumPauseLocked, Is.False, "Users may change an upper bound which the organization only presets.");
}
}
/// <summary>
/// Lets a configuration plugin set a bound of the pause.
/// </summary>
/// <param name="bound">The bound to process.</param>
/// <param name="settings">The Lua lines which fill the table SETTINGS of the plugin.</param>
/// <returns>Whether the plugin's value was taken.</returns>
private static async Task<bool> ProcessAsync(Expression<Func<DataBatchProcessing, int>> bound, string settings)
{
var state = LuaState.Create();
state.OpenBasicLibrary();
await state.DoStringAsync($"""
SETTINGS = {"{}"}
{settings}
""");
if (!state.Environment["SETTINGS"].TryRead<LuaTable>(out var settingsTable))
throw new InvalidOperationException("The settings of this test are not a Lua table.");
return ManagedConfiguration.TryProcessConfiguration(x => x.BatchProcessing, bound, PLUGIN_ID, settingsTable, false, validator: DataBatchProcessing.PAUSE_LIMITS.Allows);
}
}
-72
View File
@@ -1,72 +0,0 @@
using AIStudio.Settings.DataModel;
using AIStudio.Tools.Services.Indexing;
namespace AIStudio.Tests.Tools;
/// <summary>
/// Checks which bounds of the pause between two indexing steps apply, as the user set them and as configuration plugins lock them.
/// </summary>
[TestFixture]
public sealed class PauseRangeTests
{
[Test]
public void BoundsInOrderStayAsTheyAre()
{
Assert.That(PauseRange.GetEffective(10, false, 20, false), Is.EqualTo(new PauseRange(10, 20)));
}
[Test]
public void AnUpperBoundBelowTheLowerOneIsRaisedToIt()
{
Assert.That(PauseRange.GetEffective(60, false, 20, false), Is.EqualTo(new PauseRange(60, 60)));
}
[Test]
public void ALockedLowerBoundRaisesTheUpperOne()
{
Assert.That(PauseRange.GetEffective(60, true, 20, false), Is.EqualTo(new PauseRange(60, 60)));
}
[Test]
public void ALockedUpperBoundLowersTheLowerOne()
{
Assert.That(PauseRange.GetEffective(60, false, 20, true), Is.EqualTo(new PauseRange(20, 20)));
}
[Test]
public void BothBoundsLockedTheWrongWayRoundLetTheLongerPauseWin()
{
Assert.That(PauseRange.GetEffective(60, true, 20, true), Is.EqualTo(new PauseRange(60, 60)));
}
[Test]
public void BoundsOutsideTheAllowedRangeAreClamped()
{
Assert.That(PauseRange.GetEffective(-5, false, 1_000, false), Is.EqualTo(new PauseRange(0, DataDataSourceIndexing.MAX_PAUSE_BETWEEN_STEPS_SECONDS)));
}
[Test]
public void BoundsInOrderComeFromTheSettingsWithoutAskingForLocks()
{
var settings = new DataDataSourceIndexing
{
MinimumPauseBetweenStepsSeconds = 10,
MaximumPauseBetweenStepsSeconds = 20
};
Assert.That(PauseRange.FromSettings(settings), Is.EqualTo(new PauseRange(10, 20)));
}
[Test]
public void OnlyZeroForBothBoundsMeansNoPause()
{
using (Assert.EnterMultipleScope())
{
Assert.That(PauseRange.GetEffective(0, false, 0, false).IsNone, Is.True);
Assert.That(PauseRange.GetEffective(0, false, 5, false).IsNone, Is.False);
Assert.That(PauseRange.GetEffective(30, false, 0, false), Is.EqualTo(new PauseRange(30, 30)));
Assert.That(new DataDataSourceIndexing().MinimumPauseBetweenStepsSeconds, Is.Zero);
Assert.That(new DataDataSourceIndexing().MaximumPauseBetweenStepsSeconds, Is.Zero);
}
}
}
@@ -1,6 +1,6 @@
using AIStudio.Tools.Services.Indexing;
using AIStudio.Tools.Pauses;
namespace AIStudio.Tests.Tools;
namespace AIStudio.Tests.Tools.Pauses;
/// <summary>
/// Checks the pause between two indexing steps, which spares an embedding server that many people share.
+147
View File
@@ -0,0 +1,147 @@
using AIStudio.Settings.DataModel;
using AIStudio.Tools.Pauses;
namespace AIStudio.Tests.Tools.Pauses;
/// <summary>
/// Checks which bounds of a random pause apply, as the user set them, as configuration plugins lock them, and within the limits of each feature.
/// </summary>
[TestFixture]
public sealed class PauseRangeTests
{
private static readonly Func<bool> LOCKED = () => true;
private static readonly Func<bool> UNLOCKED = () => false;
private static readonly PauseLimits INDEXING = DataDataSourceIndexing.PAUSE_LIMITS;
private static readonly PauseLimits BATCH_PROCESSING = DataBatchProcessing.PAUSE_LIMITS;
[Test]
public void BoundsInOrderStayAsTheyAre()
{
Assert.That(PauseRange.GetEffective(INDEXING, 10, UNLOCKED, 20, UNLOCKED), Is.EqualTo(new PauseRange(10, 20)));
}
[Test]
public void AnUpperBoundBelowTheLowerOneIsRaisedToIt()
{
Assert.That(PauseRange.GetEffective(INDEXING, 60, UNLOCKED, 20, UNLOCKED), Is.EqualTo(new PauseRange(60, 60)));
}
[Test]
public void ALockedLowerBoundRaisesTheUpperOne()
{
Assert.That(PauseRange.GetEffective(INDEXING, 60, LOCKED, 20, UNLOCKED), Is.EqualTo(new PauseRange(60, 60)));
}
[Test]
public void ALockedUpperBoundLowersTheLowerOne()
{
Assert.That(PauseRange.GetEffective(INDEXING, 60, UNLOCKED, 20, LOCKED), Is.EqualTo(new PauseRange(20, 20)));
}
[Test]
public void BothBoundsLockedTheWrongWayRoundLetTheLongerPauseWin()
{
Assert.That(PauseRange.GetEffective(INDEXING, 60, LOCKED, 20, LOCKED), Is.EqualTo(new PauseRange(60, 60)));
}
[Test]
public void BoundsOutsideTheLimitsAreClamped()
{
using (Assert.EnterMultipleScope())
{
Assert.That(PauseRange.GetEffective(INDEXING, -5, UNLOCKED, 1_000, UNLOCKED), Is.EqualTo(new PauseRange(0, 300)));
Assert.That(PauseRange.GetEffective(BATCH_PROCESSING, -5, UNLOCKED, 1_000, UNLOCKED), Is.EqualTo(new PauseRange(6, 300)));
}
}
[Test]
public void BoundsBelowTheShortestPauseOfAFeatureAreRaisedToIt()
{
using (Assert.EnterMultipleScope())
{
Assert.That(PauseRange.GetEffective(BATCH_PROCESSING, 0, UNLOCKED, 3, UNLOCKED), Is.EqualTo(new PauseRange(6, 6)));
Assert.That(PauseRange.GetEffective(BATCH_PROCESSING, 2, UNLOCKED, 20, UNLOCKED), Is.EqualTo(new PauseRange(6, 20)));
}
}
[Test]
public void ALockedUpperBoundLowersTheLowerOneOnlyToTheShortestPauseOfAFeature()
{
Assert.That(PauseRange.GetEffective(BATCH_PROCESSING, 60, UNLOCKED, 2, LOCKED), Is.EqualTo(new PauseRange(6, 6)));
}
[Test]
public void TheLocksAreAskedOnlyWhileTheBoundsAreTheWrongWayRound()
{
var asked = 0;
var countingLock = () =>
{
asked++;
return false;
};
PauseRange.GetEffective(INDEXING, 10, countingLock, 10, countingLock);
PauseRange.GetEffective(INDEXING, 10, countingLock, 20, countingLock);
PauseRange.GetEffective(BATCH_PROCESSING, 0, countingLock, 3, countingLock);
Assert.That(asked, Is.Zero);
PauseRange.GetEffective(INDEXING, 20, countingLock, 10, countingLock);
Assert.That(asked, Is.Positive);
}
[Test]
public void TheIndexingTakesItsBoundsFromItsSettings()
{
var settings = new DataDataSourceIndexing
{
MinimumPauseBetweenStepsSeconds = 10,
MaximumPauseBetweenStepsSeconds = 20
};
Assert.That(settings.EffectivePauseRange, Is.EqualTo(new PauseRange(10, 20)));
}
[Test]
public void TheBatchProcessingPausesSixToTenSecondsByDefault()
{
var settings = new DataBatchProcessing();
Assert.That(PauseRange.GetEffective(BATCH_PROCESSING, settings.MinimumDelaySeconds, UNLOCKED, settings.MaximumDelaySeconds, UNLOCKED), Is.EqualTo(new PauseRange(6, 10)));
}
[Test]
public void OnlyZeroForBothBoundsMeansNoPause()
{
using (Assert.EnterMultipleScope())
{
Assert.That(PauseRange.GetEffective(INDEXING, 0, UNLOCKED, 0, UNLOCKED).IsNone, Is.True);
Assert.That(PauseRange.GetEffective(INDEXING, 0, UNLOCKED, 5, UNLOCKED).IsNone, Is.False);
Assert.That(PauseRange.GetEffective(INDEXING, 30, UNLOCKED, 0, UNLOCKED), Is.EqualTo(new PauseRange(30, 30)));
Assert.That(new DataDataSourceIndexing().EffectivePauseRange.IsNone, Is.True);
}
}
[Test]
public void TheBatchProcessingAlwaysPauses()
{
Assert.That(PauseRange.GetEffective(BATCH_PROCESSING, 0, UNLOCKED, 0, UNLOCKED).IsNone, Is.False);
}
[Test]
public void TheLimitsAllowTheirShortestAndLongestPause()
{
using (Assert.EnterMultipleScope())
{
Assert.That(INDEXING.Allows(0), Is.True);
Assert.That(INDEXING.Allows(-1), Is.False);
Assert.That(INDEXING.Allows(300), Is.True);
Assert.That(INDEXING.Allows(301), Is.False);
Assert.That(BATCH_PROCESSING.Allows(5), Is.False);
Assert.That(BATCH_PROCESSING.Allows(6), Is.True);
Assert.That(BATCH_PROCESSING.Allows(300), Is.True);
Assert.That(BATCH_PROCESSING.Allows(301), Is.False);
}
}
}