-
Notifications
You must be signed in to change notification settings - Fork 11
Merging gptel branch and main branch #29
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
base: master
Are you sure you want to change the base?
Conversation
Simplify response handling with gptel-request and gptel-fsm
|
I have tested this with |
|
Forced pushed with a cleaner history and minor cleanup |
|
Before merging this one I would like for #28 to be reviewed since it's such a huge change that fixes critical bugs. |
|
Any luck on this? |
It works perfectly for me and @douo hasn't followed up. Please check it out and post what you think. I may merge it if you don't encounter any issues. |
|
Thanks for you quick response, I will try this PR on my machine. |
Oh my bad! I thought this was a comment for the other PR. |
Aha, no concerns, I'll proceed with this PR nonetheless. |
The douo#28 PR introduces some new functions and adds extensive debugging. Move the common function and adding appropriate debug calls within gptel functions as well.
|
Before merging, can you guys check if this works as intended? |
(use-package magit-gptcommit
:load-path "~/misc/magit-gptcommit/"
:bind (:map git-commit-mode-map
("C-c C-g" . magit-gptcommit-commit-accept))
:commands (magit-gptcommit-generate)
:custom
(magit-gptcommit-backend 'gptel)
:hook (magit-status-mode . 'my/enable-gptcommit)
:init
(defun my/enable-gptcommit ()
(interactive)
(magit-gptcommit-mode 1)
(magit-gptcommit-status-buffer-setup)))This is config I tested, and this PR works totally fine for me! |
Require gptel-request and introduce a local handler alist so magit-gptcommit can merge its custom gptel handlers with the handlers provided by the gptel-request module. Instead of hardcoding the handler list, compute the unique set of handler keys from both alists and assemble a combined handler entry for each key, preserving magit-specific handlers while reusing gptel-request handlers.
This PR merges the separated gptel branch with the main branch. To support both
llmandgptel, this also adds a customizable variablemagit-gptcommit-backendwhich is expected to be eitherllmorgptel. It also removes the respectiverequirecalls, as this would expect the user to have one of the packages configured (seemagit-gptcommit--ensure-backend-loaded). I have also updated the readme accordingly. Let me know what you think.Note: to keep up with the main branch, I had been cherry-picking commits and applying them to a branch maintained in my fork. Hence why the merge history shows some of the commits already merged to master.