Skip to content

Make streaming for rewrites an independent variable #850

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion gptel-rewrite.el
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ overlay."
(const :tag "Dispatch" dispatch)
(function :tag "Custom action")))

(defcustom gptel-rewrite-stream gptel-stream
"Stream responses from the LLM as they are received while rewriting.
See `gptel-stream' for further information. This setting is only
used when rewriting."
:group 'gptel
:type 'boolean)

(defface gptel-rewrite-highlight-face
'((((class color) (min-colors 88) (background dark))
:background "#041714" :extend t :inherit default)
Expand Down Expand Up @@ -626,7 +633,7 @@ generated from functions."
(prog1 (gptel-request prompt
:dry-run dry-run
:system gptel--rewrite-directive
:stream gptel-stream
:stream gptel-rewrite-stream
:context
(let ((ov (or (cdr-safe (get-char-property-and-overlay (point) 'gptel-rewrite))
(make-overlay (region-beginning) (region-end) nil t))))
Expand Down