mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac: auto completion
This commit is contained in:
parent
fa5e1f7452
commit
c1fd1d3490
2 changed files with 13 additions and 8 deletions
|
|
@ -591,6 +591,7 @@
|
|||
)}
|
||||
placeholder={placeholder ? placeholder : $i18n.t('Send a Message')}
|
||||
largeTextAsFile={$settings?.largeTextAsFile ?? false}
|
||||
autocomplete={true}
|
||||
bind:value={prompt}
|
||||
on:keydown={async (e) => {
|
||||
e = e.detail.event;
|
||||
|
|
|
|||
|
|
@ -151,15 +151,19 @@
|
|||
Highlight,
|
||||
Typography,
|
||||
Placeholder.configure({ placeholder }),
|
||||
AIAutocompletion.configure({
|
||||
generateCompletion: async (text) => {
|
||||
if (text.trim().length === 0) {
|
||||
return null;
|
||||
}
|
||||
...(autocomplete
|
||||
? [
|
||||
AIAutocompletion.configure({
|
||||
generateCompletion: async (text) => {
|
||||
if (text.trim().length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return 'AI-generated suggestion';
|
||||
}
|
||||
})
|
||||
return 'AI-generated suggestion';
|
||||
}
|
||||
})
|
||||
]
|
||||
: [])
|
||||
],
|
||||
content: content,
|
||||
autofocus: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue