Replies: 3 comments 5 replies
-
See #189, specifically the code block under "Helper functions". Let me know if you need more help. |
Beta Was this translation helpful? Give feedback.
5 replies
-
Perhaps something like this should be added to the wiki. |
Beta Was this translation helpful? Give feedback.
0 replies
-
für the record, if somebody stumbles over this discussion and wants to implement something similar, thats the working code (require 'transient)
(defun set-gptel-model-and-backend (model backend)
"Set the gptel-model and gptel-backend variables based on the selected MODEL and BACKEND."
(setq gptel-model model)
(setq gptel-backend (cdr (assoc backend gptel--known-backends)))
(message "\"%s:%s\" selected" backend model))
(transient-define-prefix gptel-model-picker ()
"Transient for selecting AI models."
["Select AI Model"
("1" "claude opus" (lambda () (interactive) (set-gptel-model-and-backend 'claude-3-opus-20240229 "Claude")))
("2" "gpt4-turbo" (lambda () (interactive) (set-gptel-model-and-backend 'gpt-4-turbo "ChatGPT")))
("3" "gpt4o" (lambda () (interactive) (set-gptel-model-and-backend 'gpt-4o "ChatGPT")))
("4" "claude sonnet" (lambda () (interactive) (set-gptel-model-and-backend 'claude-3-5-sonnet-20240620 "Claude")))
])
(global-set-key (kbd "C-c m") 'gptel-model-picker) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Karthik, you asked in the issues, from a user perspective, what a good gptel-ui would look like.
(#249 and related issues)
I thought about this for a bit. One interesting thing i miss, is a very simple "Quickchange Menu" to change the LLM-Model.
Here is a first draft.
If you put this code in an orgmode file, and press
C-c C-c
andC-c m
the code works, but it is not connected to any function.What need is info about, how to wire this code to gptel. Of course it should not only set the string to but actually change the model.
is there any existing, documentation on how to do that, or could you provide some help?
I tried to figure it out on my own by looking at
transient-define-prefix gptel-menu ()
ingptel-transient.el
but this code is way above my novice understanding of lisp.Can you help? Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions