refac: auto completion

This commit is contained in:
Timothy Jaeryang Baek committed 2024-11-28 23:26:09 -08:00
1 parent fa5e1f7452
commit c1fd1d3490
2 files changed
+5

No files matched your search

@@ -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,6 +151,8 @@
Highlight,
Typography,
Placeholder.configure({ placeholder }),
...(autocomplete
? [
AIAutocompletion.configure({
generateCompletion: async (text) => {
if (text.trim().length === 0) {
@@ -160,6 +162,8 @@
return 'AI-generated suggestion';
}
})
]
: [])
],
content: content,
autofocus: true,