Skip to content

Commit

Permalink
gptel tweaks
Browse files Browse the repository at this point in the history
- use gptel-org-branching-context (as such remove limit on sent messages)
- add anthropic backend
  • Loading branch information
PalaceChan authored and PalaceChan committed Jan 7, 2025
1 parent af4a7fc commit 50238a2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions config.org
Original file line number Diff line number Diff line change
Expand Up @@ -1033,19 +1033,24 @@ https://github.com/karthink/gptel
(defun ava/init-gptel-mode ()
(visual-line-mode)
(setq-local gptel-expert-commands t)
(setq-local gptel--num-messages-to-send 6)
(setq-local gptel--system-message (alist-get 'default gptel-directives)))
:hook (gptel-mode . ava/init-gptel-mode)
:custom
(gptel-model 'gpt-4o)
(gptel-default-mode 'org-mode)
(gptel-track-media t)
(gptel-directives '((default . "You are a helpful assistant living inside Emacs. The user is a computer programmer. Your responses are always concise, succinct, and to the point. You never apologize for confusions as that wastes time. If you generate blocks using three backticks inspect your response and add the appropriate programming language after the opening backticks.")
(gptel-directives '((default . "You are a helpful assistant living inside Emacs. The user is a computer programmer. Your responses are always concise, succinct, and to the point. You never apologize for confusions as that wastes time. If you generate blocks using three backticks inspect your response and add the appropriate programming language after the opening backticks. Do not use the asterisk character followed by whitespace for bullet points in your responses as this can interfere with org-mode rendering (you can use a hyphen instead)")
(programmer . "You are a careful programmer. Provide code and only code as output without any additional text, prompt, or note. Do NOT use markdown backticks (```) to format your response.")
(emacser . "You are an emacs maven. Reply with the most appropriate built-in Emacs command for the task I specify. Do NOT generate any additional description or explanation.")
(cliwhiz . "You are a command line helper. Generate command line commands that do what is requested, without any additional description or explanation. Generate ONLY the command, without any markdown code fences.")
(explainer . "You are a computer programmer's assistant. Explain what this code does")
(differ . "You are a computer programmer's assistant. Explain what this code diff hunk is doing, is it trying to fix something? Is it just a refactor? What is your understanding of the diff"))))
(differ . "You are a computer programmer's assistant. Explain what this code diff hunk is doing, is it trying to fix something? Is it just a refactor? What is your understanding of the diff")))
:config
(setf (alist-get 'org-mode gptel-prompt-prefix-alist) "*Prompt*: "
(alist-get 'org-mode gptel-response-prefix-alist) "*Response*:\n")
(with-eval-after-load 'gptel-org
(setq-default gptel-org-branching-context t))
(gptel-make-anthropic "claude" :key gptel-api-key :stream t))
#+end_src
** helm
#+BEGIN_SRC emacs-lisp
Expand Down

0 comments on commit 50238a2

Please sign in to comment.