When using AI autocomplete, there was a problem that 5000 characters from the focused current location were called as a prompt due to the following location, which did not result in a proper prompt.
I tested this in my environment and was able to change the process so that only the paragraph in which the cursor is focused is recognized as a prompt by using document.getSelection().
let select = document.getSelection();
complete(
(select as any).baseNode.textContent
);
I am considering sending you a PR if you would like to do so. Thank you in advance!
Hi! I have self-hosted novel and love it.
When using AI autocomplete, there was a problem that 5000 characters from the focused current location were called as a prompt due to the following location, which did not result in a proper prompt.
https://github.com/steven-tey/novel/blob/b4526fc63175caed02bdbfbee490e87b3466dd1c/packages/core/src/ui/editor/index.tsx#L114-L118
I tested this in my environment and was able to change the process so that only the paragraph in which the cursor is focused is recognized as a prompt by using document.getSelection().
I am considering sending you a PR if you would like to do so. Thank you in advance!