Skip to content

Commit 752a2b8

Browse files
committed
Add the ability to ignore some model versions when swapping
1 parent 73dc47e commit 752a2b8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

chatgpt-shell.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ Downloaded from https://github.com/f/awesome-chatgpt-prompts."
521521
(setq chatgpt-shell-models (chatgpt-shell--make-default-models))
522522
(message "Reloaded %d models" (length chatgpt-shell-models)))
523523

524+
(defcustom chatgpt-shell-ignored-model-versions nil
525+
"The list of model versions to ignore when swapping the model."
526+
:type '(repeat string)
527+
:group 'chatgpt-shell)
528+
524529
(defun chatgpt-shell-swap-model ()
525530
"Swap model version from `chatgpt-shell-models'."
526531
(interactive)
@@ -539,7 +544,10 @@ Downloaded from https://github.com/f/awesome-chatgpt-prompts."
539544
(format (format "%%-%ds %%s" width)
540545
(map-elt model :provider)
541546
(map-elt model :version)))
542-
chatgpt-shell-models))
547+
(seq-filter (lambda (model)
548+
(not (member (map-elt model :version)
549+
chatgpt-shell-ignored-model-versions)))
550+
chatgpt-shell-models)))
543551
(selection (nth 1 (split-string (completing-read "Model version: "
544552
models nil t)))))
545553
(progn

0 commit comments

Comments
 (0)