[emacs] More tweaks for "AI"
This commit is contained in:
parent
4c61541f83
commit
39ad97cfa7
2 changed files with 25 additions and 5 deletions
|
|
@ -1422,19 +1422,38 @@ Do this when you edit your project view."
|
||||||
(error "Claude API key not found in keys.json")))
|
(error "Claude API key not found in keys.json")))
|
||||||
(error "Key file keys.json file not found at %s" keys-file))))
|
(error "Key file keys.json file not found at %s" keys-file))))
|
||||||
|
|
||||||
|
(defconst my/gptel-databricks-path
|
||||||
|
(expand-file-name "~/universe/experimental/john.doty/gptel-databricks/")
|
||||||
|
"The path to the databricks gptel backend.")
|
||||||
|
|
||||||
|
(defconst my/has-gptel-databricks
|
||||||
|
(file-exists-p my/gptel-databricks-path)
|
||||||
|
"Whether or not we have the databricks gptel backend.")
|
||||||
|
|
||||||
|
(defun my/get-gptel-backend ()
|
||||||
|
"Produce the right backend based on my environment."
|
||||||
|
(if my/has-gptel-databricks
|
||||||
|
(progn
|
||||||
|
(add-to-list 'load-path (directory-file-name my/gptel-databricks-path))
|
||||||
|
(require 'gptel-databricks)
|
||||||
|
(gptel-make-databricks "Databricks" :stream t))
|
||||||
|
(gptel-make-anthropic "Claude"
|
||||||
|
:stream t
|
||||||
|
:key #'claude-get-api-key
|
||||||
|
:request-params '(:thinking (:type "enabled" :budget_tokens 2048)
|
||||||
|
:max_tokens 4096))))
|
||||||
|
|
||||||
(use-package gptel :ensure
|
(use-package gptel :ensure
|
||||||
:bind (:map gptel-mode-map
|
:bind (:map gptel-mode-map
|
||||||
("C-c C-g" . gptel-menu)
|
("C-c C-g" . gptel-menu)
|
||||||
("C-c C-t" . gptel-tools))
|
("C-c C-t" . gptel-tools))
|
||||||
|
|
||||||
:config
|
:config
|
||||||
|
|
||||||
(setq
|
(setq
|
||||||
gptel-model 'claude-3-7-sonnet-20250219 ; "claude-3-opus-20240229" also available
|
gptel-model 'claude-3-7-sonnet-20250219 ; "claude-3-opus-20240229" also available
|
||||||
gptel-backend (gptel-make-anthropic "Claude"
|
gptel-backend (my/get-gptel-backend))
|
||||||
:stream t
|
(require 'doty-tools))
|
||||||
:key #'claude-get-api-key
|
|
||||||
:request-params '(:thinking (:type "enabled" :budget_tokens 2048)
|
|
||||||
:max_tokens 4096))))
|
|
||||||
|
|
||||||
|
|
||||||
;; =================================================================
|
;; =================================================================
|
||||||
|
|
|
||||||
|
|
@ -656,4 +656,5 @@ If END-LINE is not provided, only delete START-LINE."
|
||||||
:confirm t ;; For security, prompt the user before running any shell command
|
:confirm t ;; For security, prompt the user before running any shell command
|
||||||
:include t) ;; Include the command output in the conversation
|
:include t) ;; Include the command output in the conversation
|
||||||
|
|
||||||
|
(provide 'doty-tools)
|
||||||
;;; doty-tools.el ends here
|
;;; doty-tools.el ends here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue