Skip to content
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

Feature request: If nothing is selected use the current line as prompt #19

Closed
tmalsburg opened this issue Mar 22, 2023 · 6 comments
Closed
Labels
enhancement New feature or request

Comments

@tmalsburg
Copy link

No description provided.

@karthink
Copy link
Owner

karthink commented Mar 22, 2023

I'm assuming you mean this in non-dedicated buffers, for example in a buffer with some code?

If nothing is selected it already uses the contents of the buffer until (point) as the prompt. This includes identifying past responses as responses. The readme suggests selecting a region first to limit the text that's used as the prompt, since you may not want to send everything from the beginning of the buffer to the cursor position.

However I don't see the point of sending just the current line by default. Could you explain the advantage of this behavior?

@tmalsburg
Copy link
Author

Thanks for the response. From the readme it wasn't clear to me that the behavior for no selection is already defined.

I'm assuming you mean this in non-dedicated buffers, for example in a buffer with some code?

Yes, sorry should have added more detail.

However I don't see the point of sending just the current line by default. Could you explain the advantage of this behavior?

The previous part of the buffer up to point it often too much context and irrelevant. For my personal use cases the current line is often enough as a prompt. But I should say, that I'm not primarily using it for code but for text. When writing text, I use visual-line-mode and a buffer line can be a whole paragraph.

By the way, I noticed that sometimes existing text is deleted when GPT responses are inserted in the buffer. But it seemed a bit random and I wanted to get a better understanding of what's going on before creating an issue for that.

@karthink
Copy link
Owner

From the readme it wasn't clear to me that the behavior for no selection is already defined.

Yes, this is intentional since the behavior with no selection is not finalized yet.

The previous part of the buffer up to point it often too much context and irrelevant.

I agree generally, but it depends on how you're using ChatGPT here. With the current behavior you can have a continuous conversation in any buffer, not just a dedicated one created with M-x gptel. I haven't found the right tradeoff yet. I'll try experimenting with this behavior for a bit.

@karthink
Copy link
Owner

karthink commented Mar 23, 2023

By the way, I noticed that sometimes existing text is deleted when GPT responses are inserted in the buffer. But it seemed a bit random and I wanted to get a better understanding of what's going on before creating an issue for that.

If this is the case, it's a bug. The desired behavior is to always insert the response below the current line.

Does it happen in dedicated gptel buffers, or in other buffers when you select a region, or both?

@tmalsburg
Copy link
Author

Does it happen in dedicated gptel buffers, or in other buffers when you select a region, or both?

I actually haven't used the dedicated buffer yet, so I don't know whether it happens there. But it does happen in other buffers. The buffer in which it happened was an org mode buffer and the GPT response replaced a subsequent org section header. If I find time I will try to come up with a reproducible example and create another issue.

@karthink karthink added the enhancement New feature or request label Mar 24, 2023
@karthink
Copy link
Owner

karthink commented Apr 9, 2023

@tmalsburg Please see the wiki for options. It should be easy to get this behavior using gptel-request. I don't think I'll be adding sending the current line as a default, it doesn't fit with the rest of the design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants