Einstellungen: Vorauswahl für KI-Generierung (Dokumente + Anlagen)
Zwei neue, pro Benutzer gespeicherte Konfigurationswerte: GEN_DOKUMENTE_DEFAULT (Standard: Anschreiben + Lebenslauf) und GEN_ANLAGEN_DEFAULT (Standard: keine). Sie belegen die Häkchen auf der Bewerbungsseite vor; eine bereits getroffene Dokumentenauswahl der Bewerbung gewinnt weiterhin. Die REST-API nutzt die Vorauswahl, wenn dokumente/anlagen im Body fehlen. Die Einstellungsseite kennt dafür jetzt Checkbox-Gruppen, deren Optionen auch erst zur Renderzeit feststehen dürfen (die eigenen Anlagen). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-1
@@ -153,13 +153,20 @@ const OUTPUT_SCHEMA = {
|
||||
const DOKUMENT_TYPEN = ['anschreiben', 'lebenslauf'];
|
||||
|
||||
// Accept anything (string, array, undefined) and return a clean, ordered list.
|
||||
// Empty / unknown input means "both" — the default everywhere.
|
||||
// Empty / unknown input means "both" — the fallback everywhere.
|
||||
function normalizeDokumente(v) {
|
||||
const gewaehlt = [].concat(v == null ? [] : v).map((x) => String(x).trim().toLowerCase());
|
||||
const gefiltert = DOKUMENT_TYPEN.filter((d) => gewaehlt.includes(d));
|
||||
return gefiltert.length ? gefiltert : DOKUMENT_TYPEN.slice();
|
||||
}
|
||||
|
||||
// The current user's preselection (Einstellungen → GEN_DOKUMENTE_DEFAULT): which
|
||||
// documents are ticked when a generation is started without an explicit choice.
|
||||
// An empty / unknown setting falls back to both.
|
||||
function standardDokumente() {
|
||||
return normalizeDokumente(String(config.get('GEN_DOKUMENTE_DEFAULT') || '').split(','));
|
||||
}
|
||||
|
||||
// Ask the model only for the documents we actually want. Dropping a section from
|
||||
// the schema means the model never writes it — that saves a chunk of generation
|
||||
// time and tokens when only one document is needed.
|
||||
@@ -3403,4 +3410,5 @@ module.exports = {
|
||||
renderDesignVorschau,
|
||||
DOKUMENT_TYPEN,
|
||||
normalizeDokumente,
|
||||
standardDokumente,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user