Optional title generation

The boolean configuration var ENABLE_TITLE_GENERATION makes title generation optionaL
This commit is contained in:
Nacho G. Mac Dowell
2025-02-13 16:28:39 +01:00
parent 3ac3615ecd
commit c47eddce32
43 changed files with 120 additions and 12 deletions

View File

@@ -23,6 +23,7 @@
let taskConfig = {
TASK_MODEL: '',
TASK_MODEL_EXTERNAL: '',
ENABLE_TITLE_GENERATION: true,
TITLE_GENERATION_PROMPT_TEMPLATE: '',
IMAGE_PROMPT_GENERATION_PROMPT_TEMPLATE: '',
ENABLE_AUTOCOMPLETE_GENERATION: true,
@@ -126,22 +127,36 @@
</div>
</div>
<div class="mt-3">
<div class=" mb-2.5 text-xs font-medium">{$i18n.t('Title Generation Prompt')}</div>
<hr class=" border-gray-50 dark:border-gray-850 my-3" />
<Tooltip
content={$i18n.t('Leave empty to use the default prompt, or enter a custom prompt')}
placement="top-start"
>
<Textarea
bind:value={taskConfig.TITLE_GENERATION_PROMPT_TEMPLATE}
placeholder={$i18n.t(
'Leave empty to use the default prompt, or enter a custom prompt'
)}
/>
<div class="my-3 flex w-full items-center justify-between">
<div class=" self-center text-xs font-medium">
{$i18n.t('Title Generation')}
</div>
<Tooltip content={$i18n.t('Enable title generation for chat messages')}>
<Switch bind:state={taskConfig.ENABLE_TITLE_GENERATION} />
</Tooltip>
</div>
{#if taskConfig.ENABLE_TITLE_GENERATION}
<div class="mt-3">
<div class=" mb-2.5 text-xs font-medium">{$i18n.t('Title Generation Prompt')}</div>
<Tooltip
content={$i18n.t('Leave empty to use the default prompt, or enter a custom prompt')}
placement="top-start"
>
<Textarea
bind:value={taskConfig.TITLE_GENERATION_PROMPT_TEMPLATE}
placeholder={$i18n.t(
'Leave empty to use the default prompt, or enter a custom prompt'
)}
/>
</Tooltip>
</div>
{/if}
<div class="mt-3">
<div class=" mb-2.5 text-xs font-medium">{$i18n.t('Image Prompt Generation Prompt')}</div>