-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.el
39 lines (35 loc) · 985 Bytes
/
dev.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(setq openai-api-key
(or (when (file-exists-p "token.gpg" )
(-last-item
(process-lines "gpg" "--decrypt" "token.gpg")))
(string-trim (shell-command-to-string "pass ben-open-ai"))))
(meow-leader-define-key
`("." .
,(let ((m (make-sparse-keymap)))
(define-key m (kbd "e") #'openai-api-davinci-edit)
(define-key m (kbd "E") #'openai-api-edit-text)
(define-key m (kbd "t") #'openai-api-complete-text-small)
(define-key m (kbd "l") #'openai-api-explain-region)
;; I was playing around with telling the model to "fix the todos in this code"
(define-key m (kbd "i") (defun mm/insert-todo ()
(interactive)
(insert "TODO: ")
(comment-line 1)))
m)))
(define-key openai-api-keymap (kbd "f") #'openai-api-fact-bot)
Dog
Snake
Bird
Cat
Fish
Lizard
Rabbit
Horse
Goat
Sheep
Pig
Mouse
Frog
Turtle
Crocodile
Hamster