mirror of
https://github.com/open-webui/open-webui
synced 2024-12-29 07:12:07 +00:00
refac: auto completion
This commit is contained in:
parent
fa5e1f7452
commit
c1fd1d3490
@ -591,6 +591,7 @@
|
|||||||
)}
|
)}
|
||||||
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={true}
|
||||||
bind:value={prompt}
|
bind:value={prompt}
|
||||||
on:keydown={async (e) => {
|
on:keydown={async (e) => {
|
||||||
e = e.detail.event;
|
e = e.detail.event;
|
||||||
|
@ -151,6 +151,8 @@
|
|||||||
Highlight,
|
Highlight,
|
||||||
Typography,
|
Typography,
|
||||||
Placeholder.configure({ placeholder }),
|
Placeholder.configure({ placeholder }),
|
||||||
|
...(autocomplete
|
||||||
|
? [
|
||||||
AIAutocompletion.configure({
|
AIAutocompletion.configure({
|
||||||
generateCompletion: async (text) => {
|
generateCompletion: async (text) => {
|
||||||
if (text.trim().length === 0) {
|
if (text.trim().length === 0) {
|
||||||
@ -160,6 +162,8 @@
|
|||||||
return 'AI-generated suggestion';
|
return 'AI-generated suggestion';
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
]
|
||||||
|
: [])
|
||||||
],
|
],
|
||||||
content: content,
|
content: content,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user