Created
October 16, 2023 16:48
-
-
Save codeasone/4cf214c1645dbd8a979d4598da97e6c9 to your computer and use it in GitHub Desktop.
Minimal reproduction environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'package) | |
(setq package-archives '(("melpa" . "https://melpa.org/packages/") | |
("elpa" . "https://elpa.gnu.org/packages/"))) | |
(setq package-archive-priorities '(("melpa" . 10) ("elpa" . 5))) | |
(use-package org-roam | |
:ensure t | |
:demand t | |
:custom | |
(org-roam-directory (expand-file-name "~/Documents/Org"))) | |
(use-package auth-source-pass | |
:demand t | |
:config | |
(cl-defun | |
auth-get-passwd | |
(&rest spec &allow-other-keys) | |
"Helper to get the password given the SPEC from authsource." | |
(let ((founds (apply 'auth-source-pass-search spec))) | |
(when founds | |
(funcall (plist-get (nth 0 founds) :secret))))) | |
(auth-source-pass-enable)) | |
(use-package gptel | |
:ensure t | |
:hook (org-mode . gptel-mode) | |
:custom | |
(gptel-default-mode 'org-mode) | |
(gptel-model "gpt-4") | |
(gptel-api-key (auth-get-passwd :host "openai.com" :user "codeasone")) | |
(gptel-prompt-prefix-alist | |
'((markdown-mode . "# ") | |
(org-mode . "* ") | |
(text-mode . "# ")) | |
:group 'gptel | |
:type '(alist :key-type symbol :value-type string))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment