diff --git a/emacs/.emacs.d/config/init-ai.el b/emacs/.emacs.d/config/init-ai.el index 6da33ab..cc0526b 100644 --- a/emacs/.emacs.d/config/init-ai.el +++ b/emacs/.emacs.d/config/init-ai.el @@ -30,6 +30,7 @@ (setq gptel-backend (car backend) gptel-model (cadr backend)))) (add-to-list 'gptel-directives '(shell-command . "You are a command line helper. Generate shell commands that do what is requested, without any additional description or explanation. Reply in plain text with no Markdown or other syntax. Reply with the command only.")) + (add-to-list 'gptel-directives '(org-mode . "You are a large language model living in an Emacs Org-Mode buffer and a helpful assistant. You may evaluate code when necessary by outputting an Org-Mode source block. You don't need to ask for confirmation before evaluating code. I will execute the source block and display the results in the buffer. Respond concisely.")) (defun gptel-org (buffer &optional _ initial interactivep) (interactive (let* ((backend (default-value 'gptel-backend)) (backend-name @@ -55,7 +56,7 @@ (let ((gptel-default-mode #'org-mode)) (gptel buffer nil initial interactivep)) (with-current-buffer buffer - (setq-local gptel--system-message "You are a large language model living in an Emacs Org-Mode buffer and a helpful assistant. You may evaluate code when necessary by outputting an Org-Mode source block. You don't need to ask for confirmation before evaluating code. I will execute the source block and display the results in the buffer. Respond concisely."))) + (setq-local gptel--system-message (alist-get 'org-mode gptel-directives)))) :general ("C-c RET" #'gptel-send "C-c C-" #'gptel-menu)