-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Awkward behavior due to openai-completion-select-insert calling (forward-paragraph) #20
Comments
Yeah, you are correct. I've re-implemented it in 6a1d270, so it works better in most circumstances. Basically, it will always insert the output with newlines at the front and at the end. This way user can see the output better and know what to do later on (remove it? or merge it into the paragraph? etc). Can you try the latest version? Thanks! |
I tested the new version and found that if I submit a statement such as (1) "Define a Hamel basis in R^2.\n" or (2) "Define a Hamel basis in R^2.", the new version inserts the response to (1) before "^2" and to (2) after "^2" but before "." |
Can you paste a screenshot or steps to reproduce the issue? It's hard to imagine the error by reading the description. Thanks! |
Write "Define a Hamel basis in R^2." into the scratch buffer. Observed behavior: A Hamel basis in R^2 is any set of two linearly independent vectors that span ." Notice the extra dot at the end of the text which is now missing from the end of the original text. The behavior becomes even stranger if one marks "Define a Hamel basis in R^2.\n". |
This is the result on my end:
It seems fine to me. 🤔 |
I wonder what the issue is. Must be something related to spacemacs I would guess. Somehow both the chatgpt and this package don't work well with each other. |
If you use openai-completion-select-insert on a selected paragraph, then the response will be inserted after the following paragraph instead of directly after the paragraph.
This happens because openai-completion-select-insert calls (forward-paragraph) before insertion.
Of course it is equally awkward if after selecting only part of a paragraph and sending it to openai, the result appears in the middle of the paragraph, so just removing (forward-paragraph) would not be good.
I do not know an elegant solution to this issue. Perhaps it is possible to pass an optional argument to openai-completion-select-insert not to skip to the next paragraph? Similar issues may arise due to newline characters being added (in some use cases these might not be desirable). If one could pass optional arguments such as "prefix", "suffix" (which default to "\n") and "position" (which defaults to "(goto-char end) (forward-paragraph)"), then this would allow users to use for example advice-add to fine-tune the placement of the response.
The text was updated successfully, but these errors were encountered: