mirror of
https://github.com/open-webui/open-webui
synced 2025-04-16 21:42:50 +00:00
feat: prompt autocompletion user setting
This commit is contained in:
parent
50b8dec3ac
commit
d41844c308
@ -694,7 +694,8 @@
|
|||||||
))}
|
))}
|
||||||
placeholder={placeholder ? placeholder : $i18n.t('Send a Message')}
|
placeholder={placeholder ? placeholder : $i18n.t('Send a Message')}
|
||||||
largeTextAsFile={$settings?.largeTextAsFile ?? false}
|
largeTextAsFile={$settings?.largeTextAsFile ?? false}
|
||||||
autocomplete={$config?.features.enable_autocomplete_generation}
|
autocomplete={$config?.features?.enable_autocomplete_generation &&
|
||||||
|
($settings?.promptAutocomplete ?? false)}
|
||||||
generateAutoCompletion={async (text) => {
|
generateAutoCompletion={async (text) => {
|
||||||
if (selectedModelIds.length === 0 || !selectedModelIds.at(0)) {
|
if (selectedModelIds.length === 0 || !selectedModelIds.at(0)) {
|
||||||
toast.error($i18n.t('Please select a model first.'));
|
toast.error($i18n.t('Please select a model first.'));
|
||||||
|
@ -30,10 +30,13 @@
|
|||||||
// Interface
|
// Interface
|
||||||
let defaultModelId = '';
|
let defaultModelId = '';
|
||||||
let showUsername = false;
|
let showUsername = false;
|
||||||
let richTextInput = true;
|
|
||||||
let largeTextAsFile = false;
|
|
||||||
let notificationSound = true;
|
let notificationSound = true;
|
||||||
|
|
||||||
|
let richTextInput = true;
|
||||||
|
let promptAutocomplete = false;
|
||||||
|
|
||||||
|
let largeTextAsFile = false;
|
||||||
|
|
||||||
let landingPageMode = '';
|
let landingPageMode = '';
|
||||||
let chatBubble = true;
|
let chatBubble = true;
|
||||||
let chatDirection: 'LTR' | 'RTL' = 'LTR';
|
let chatDirection: 'LTR' | 'RTL' = 'LTR';
|
||||||
@ -73,6 +76,11 @@
|
|||||||
saveSettings({ splitLargeChunks: splitLargeChunks });
|
saveSettings({ splitLargeChunks: splitLargeChunks });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const togglePromptAutocomplete = async () => {
|
||||||
|
promptAutocomplete = !promptAutocomplete;
|
||||||
|
saveSettings({ promptAutocomplete: promptAutocomplete });
|
||||||
|
};
|
||||||
|
|
||||||
const togglesScrollOnBranchChange = async () => {
|
const togglesScrollOnBranchChange = async () => {
|
||||||
scrollOnBranchChange = !scrollOnBranchChange;
|
scrollOnBranchChange = !scrollOnBranchChange;
|
||||||
saveSettings({ scrollOnBranchChange: scrollOnBranchChange });
|
saveSettings({ scrollOnBranchChange: scrollOnBranchChange });
|
||||||
@ -238,6 +246,7 @@
|
|||||||
voiceInterruption = $settings.voiceInterruption ?? false;
|
voiceInterruption = $settings.voiceInterruption ?? false;
|
||||||
|
|
||||||
richTextInput = $settings.richTextInput ?? true;
|
richTextInput = $settings.richTextInput ?? true;
|
||||||
|
promptAutocomplete = $settings.promptAutocomplete ?? false;
|
||||||
largeTextAsFile = $settings.largeTextAsFile ?? false;
|
largeTextAsFile = $settings.largeTextAsFile ?? false;
|
||||||
|
|
||||||
collapseCodeBlocks = $settings.collapseCodeBlocks ?? false;
|
collapseCodeBlocks = $settings.collapseCodeBlocks ?? false;
|
||||||
@ -564,6 +573,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{#if $config?.features?.enable_autocomplete_generation && richTextInput}
|
||||||
|
<div>
|
||||||
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
|
<div class=" self-center text-xs">
|
||||||
|
{$i18n.t('Prompt Autocompletion')}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="p-1 px-3 text-xs flex rounded-sm transition"
|
||||||
|
on:click={() => {
|
||||||
|
togglePromptAutocomplete();
|
||||||
|
}}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
{#if promptAutocomplete === true}
|
||||||
|
<span class="ml-2 self-center">{$i18n.t('On')}</span>
|
||||||
|
{:else}
|
||||||
|
<span class="ml-2 self-center">{$i18n.t('Off')}</span>
|
||||||
|
{/if}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class=" py-0.5 flex w-full justify-between">
|
<div class=" py-0.5 flex w-full justify-between">
|
||||||
<div class=" self-center text-xs">
|
<div class=" self-center text-xs">
|
||||||
|
Loading…
Reference in New Issue
Block a user