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

gptel-rewrite often fails to generate code-only responses #489

Open
1 task done
guibor opened this issue Nov 29, 2024 · 3 comments
Open
1 task done

gptel-rewrite often fails to generate code-only responses #489

guibor opened this issue Nov 29, 2024 · 3 comments
Labels
question Further information is requested

Comments

@guibor
Copy link

guibor commented Nov 29, 2024

Please update gptel first -- errors are often fixed by the time they're reported.

  • I have updated gptel to the latest commit and tested that the issue still exists

Bug Description

When using gptel-rewrite on a region, I get full responses with explanations (e.g., "Install package X, and then do this" rather than a diff that can be applied)

Backend

None

Steps to Reproduce

Any gptel-rewrite on Python code often reproduces this.

Additional Context

29.2, Mac OS X

Backtrace

No response

Log Information

No response

@guibor guibor added the bug Something isn't working label Nov 29, 2024
@karthink
Copy link
Owner

karthink commented Nov 29, 2024

  1. Can you give me an example of the rewrite directive you supply?
  2. What model are you using?

@karthink karthink added question Further information is requested and removed bug Something isn't working labels Nov 29, 2024
@guibor
Copy link
Author

guibor commented Nov 29, 2024

I don't have the directive but it wasn't the default one that instructs the model to only output code (I didn't realize that gptel-rewrite relies on the directive for that).
Might be worth making into an option (set by default to true in prog-mode buffers, or at least have all other words in comments) rather than adding to a potentially long directive

@guibor guibor closed this as completed Nov 29, 2024
@karthink
Copy link
Owner

Reopening since there is either a bug or some misunderstanding.

(I didn't realize that gptel-rewrite relies on the directive for that).

It does not. The only instruction fed to the rewrite request is whatever you give it in the menu:
image

So you do not need to set the system message every time you want to call the rewrite function.

Might be worth making into an option

So this doesn't apply. However, I do want to make it easier to specify the rewrite instructions, by templating out the common part (the part that instructs the model to respond without comments).


That brings us to your question: what rewrite instructions were you giving the model when it generated general text instead of code?

@karthink karthink reopened this Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants