Closed tshu-w closed 1 year ago
Cyclic selection is built into transient (I think) as one of the infix classes, you don't need to supply a custom reader.
While there are only three models right now, I'm planning to add support for more in the future (such as many local LLMs and DALL-E), so cyclic selection will become cumbersome then.
My suggestion for now is to use the reader you supplied as a custom function and bind it to a key:
(defun gptel-model-cycle ()
(interactive)
(let ((gptel--models '("gpt-3.5-turbo-0301" "gpt-3.5-turbo" "gpt-4")))
(setq-local gptel-model
(nth (% (1+ (cl-position gptel-model gptel--models :test #'equal))
(length gptel--models))
gptel--models))))
I understand the problem though -- let me think for a bit about how the UI can be better.
- Cyclic selection is built into transient (I think) as one of the infix classes, you don't need to supply a custom reader.
Thank you for mentioning it. I am not very familiar with transient
and I found that I cannot make transient switches select to save to gptel-model
.
While there are only three models right now, I'm planning to add support for more in the future (such as many local LLMs and DALL-E), so cyclic selection will become cumbersome then.
I understand your concern and I'll close this issue as the user can override gptel--infix-model
easily.
BTW, I wonder if there is any way to select a directive and quit without press q.
I often switch
gptel-model
, but currently the reader ofgptel--infix-mode
usescompleting-read
, which requires selecting the model and pressing enter every time. I think it can be changed to cyclic selection and the candidates can be configurable. I can submit a PR, but I would like to know your thoughts.