Titellänge nun parametrisierbar

This commit is contained in:
2026-04-22 09:53:03 +02:00
parent 088fd85572
commit 8286d0f0e5
74 changed files with 1450 additions and 236 deletions
@@ -1370,7 +1370,7 @@ public final class GuiConfigurationEditorWorkspace {
// =========================================================================
/**
* Builds the "Verarbeitungslimits" section with text fields for the three numeric limit
* Builds the "Verarbeitungslimits" section with text fields for the numeric limit
* parameters and a checkbox for the sensitive-logging flag.
*
* @return the card node for the "Verarbeitungslimits" section
@@ -1392,6 +1392,11 @@ public final class GuiConfigurationEditorWorkspace {
val -> updateValues(editorState.values().withMaxTextCharacters(val)));
addSimpleRow(grid, row++, "Maximale Zeichenzahl:", maxCharsField);
TextField maxTitleLengthField = boundTextField(
editorState.values().maxTitleLength(),
val -> updateValues(editorState.values().withMaxTitleLength(val)));
addSimpleRow(grid, row++, "Max. Titellänge (Zeichen):", maxTitleLengthField);
TextField maxRetriesField = boundTextField(
editorState.values().maxRetriesTransient(),
val -> updateValues(editorState.values().withMaxRetriesTransient(val)));
@@ -1587,6 +1592,7 @@ public final class GuiConfigurationEditorWorkspace {
values.maxRetriesTransient(),
values.maxPages(),
values.maxTextCharacters(),
values.maxTitleLength(),
claudeState.baseUrl(),
claudeState.model(),
claudeState.timeoutSeconds(),
@@ -92,6 +92,7 @@ public final class GuiApiKeyMerger {
current.maxRetriesTransient(),
current.maxPages(),
current.maxTextCharacters(),
current.maxTitleLength(),
current.logAiSensitive(),
current.activeProviderFamily(),
merged);
@@ -25,6 +25,7 @@ public final class GuiConfigurationEditorStateFactory {
private static final String PROP_MAX_RETRIES_TRANSIENT = "max.retries.transient";
private static final String PROP_MAX_PAGES = "max.pages";
private static final String PROP_MAX_TEXT_CHARACTERS = "max.text.characters";
private static final String PROP_MAX_TITLE_LENGTH = "max.title.length";
private static final String PROP_LOG_AI_SENSITIVE = "log.ai.sensitive";
private static final String PROP_ACTIVE_PROVIDER = "ai.provider.active";
private static final String PROP_CLAUDE_BASE_URL = "ai.provider.claude.baseUrl";
@@ -74,6 +75,7 @@ public final class GuiConfigurationEditorStateFactory {
propertyOrBlank(properties, PROP_MAX_RETRIES_TRANSIENT),
propertyOrBlank(properties, PROP_MAX_PAGES),
propertyOrBlank(properties, PROP_MAX_TEXT_CHARACTERS),
propertyOrBlank(properties, PROP_MAX_TITLE_LENGTH),
propertyOrBlank(properties, PROP_LOG_AI_SENSITIVE),
propertyOrBlank(properties, PROP_ACTIVE_PROVIDER),
providerConfigurations);
@@ -24,6 +24,7 @@ public final class GuiConfigurationTemplateFactory {
private static final String MAX_RETRIES_TRANSIENT = "3";
private static final String MAX_PAGES = "10";
private static final String MAX_TEXT_CHARACTERS = "5000";
private static final String DEFAULT_MAX_TITLE_LENGTH = "60";
private static final String OPENAI_BASE_URL = "https://api.openai.com/v1";
private static final String OPENAI_MODEL = "gpt-4o-mini";
@@ -83,6 +84,7 @@ public final class GuiConfigurationTemplateFactory {
"",
"",
"",
"",
Map.of());
return new GuiConfigurationEditorState(Optional.empty(), blankValues, blankValues, Optional.empty());
}
@@ -116,6 +118,7 @@ public final class GuiConfigurationTemplateFactory {
MAX_RETRIES_TRANSIENT,
MAX_PAGES,
MAX_TEXT_CHARACTERS,
DEFAULT_MAX_TITLE_LENGTH,
Boolean.toString(false),
AiProviderFamily.CLAUDE.getIdentifier(),
providerConfigurations);
@@ -23,6 +23,7 @@ import de.gecheckt.pdf.umbenenner.application.config.provider.AiProviderFamily;
* @param maxRetriesTransient transient retry limit as editable text
* @param maxPages page limit as editable text
* @param maxTextCharacters text limit as editable text
* @param maxTitleLength maximum base-title length as editable text
* @param logAiSensitive raw value of {@code log.ai.sensitive} as editable text
* @param activeProviderFamily raw value of {@code ai.provider.active} as editable text
* @param providerConfigurations provider-specific editor state keyed by provider family
@@ -38,6 +39,7 @@ public record GuiConfigurationValues(
String maxRetriesTransient,
String maxPages,
String maxTextCharacters,
String maxTitleLength,
String logAiSensitive,
String activeProviderFamily,
Map<AiProviderFamily, GuiProviderConfigurationState> providerConfigurations) {
@@ -55,6 +57,7 @@ public record GuiConfigurationValues(
* @param maxRetriesTransient transient retry limit; {@code null} becomes an empty string
* @param maxPages page limit; {@code null} becomes an empty string
* @param maxTextCharacters text limit; {@code null} becomes an empty string
* @param maxTitleLength maximum base-title length; {@code null} becomes an empty string
* @param logAiSensitive raw {@code log.ai.sensitive} value; {@code null} becomes an empty string
* @param activeProviderFamily raw {@code ai.provider.active} value; {@code null} becomes an empty string
* @param providerConfigurations provider-specific state map; must not be {@code null}
@@ -70,6 +73,7 @@ public record GuiConfigurationValues(
maxRetriesTransient = normalizeText(maxRetriesTransient);
maxPages = normalizeText(maxPages);
maxTextCharacters = normalizeText(maxTextCharacters);
maxTitleLength = normalizeText(maxTitleLength);
logAiSensitive = normalizeText(logAiSensitive);
activeProviderFamily = normalizeText(activeProviderFamily);
@@ -98,7 +102,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withActiveProviderFamily(String providerFamily) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, providerFamily, providerConfigurations);
maxTitleLength, logAiSensitive, providerFamily, providerConfigurations);
}
/**
@@ -110,7 +114,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withSourceFolder(String value) {
return new GuiConfigurationValues(value, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -122,7 +126,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withTargetFolder(String value) {
return new GuiConfigurationValues(sourceFolder, value, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -134,7 +138,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withSqliteFile(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, value, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -146,7 +150,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withPromptTemplateFile(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, value,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -158,7 +162,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withRuntimeLockFile(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
value, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -170,7 +174,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withLogDirectory(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, value, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -182,7 +186,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withLogLevel(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, value, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -194,7 +198,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withMaxRetriesTransient(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, value, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -206,7 +210,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withMaxPages(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, value, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -218,7 +222,19 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withMaxTextCharacters(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, value,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
* Returns a copy with a different maximum base-title length value.
*
* @param value new value; {@code null} becomes an empty string
* @return a new configuration values object with the requested title-length value
*/
public GuiConfigurationValues withMaxTitleLength(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
value, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**
@@ -230,7 +246,7 @@ public record GuiConfigurationValues(
public GuiConfigurationValues withLogAiSensitive(String value) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
value, activeProviderFamily, providerConfigurations);
maxTitleLength, value, activeProviderFamily, providerConfigurations);
}
/**
@@ -243,7 +259,7 @@ public record GuiConfigurationValues(
Map<AiProviderFamily, GuiProviderConfigurationState> providerConfigurations) {
return new GuiConfigurationValues(sourceFolder, targetFolder, sqliteFile, promptTemplateFile,
runtimeLockFile, logDirectory, logLevel, maxRetriesTransient, maxPages, maxTextCharacters,
logAiSensitive, activeProviderFamily, providerConfigurations);
maxTitleLength, logAiSensitive, activeProviderFamily, providerConfigurations);
}
/**