-
Notifications
You must be signed in to change notification settings - Fork 271
gptel: Make gptel-model variable definition dynamic #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks! Now that I look at the code, this list is ChatGPT specific and alternatives like Claude are very popular now (as opposed to an year ago), so I'm thinking we don't even need to "hard-code" the options in the docstring. We can just say that What do you think? |
This looks like an improvement. I would question having a hard-coded default value. Can't we just decide the default based on the first one a configuration is found for? That might need to happen downstream. This variable would be nil in most cases and could be set / bound only when there was more than one option and the default wasn't already first. The way things are going, we're rapidly going to wind up with several models available being the norm. Some for completions, some for translation, some for specific languages, some local, some remote. I don't expect this variable to have meaning in that direction. |
The user is expected to set
|
I agree that listing the models in the docstring is unnecessary, so I'll drop that part. However, we might consider including the available models from the default OpenAI backend or the currently active backend. I'm uncertain option would be the best approach for listing them, and how to get the list of models of the current backend. |
* gptel.el (gptel-model): Ensure the docstring documentation and customization options are current (in sync with `gptel--openai-models') by dynamically generating them instead of hard-coding.
This looks good to me.
While you can do something like this to use the currently active backend: :type `(choice
(symbol :tag "Specify model name")
,@(mapcar (lambda (model)
(list 'const :tag (symbol-name (car model))
(car model)))
(gptel-backend-models gptel-backend))) it won't actually work because the |
Can I go ahead and merge this now? |
Yes I think it's good enough, thanks. |
@pabl0 Thanks for the PR! |
* gptel.el (gptel-model): Ensure the docstring documentation and customization options are current (in sync with `gptel--openai-models') by dynamically generating them instead of hard-coding.
`gptel--openai-models') by dynamically generating them instead of hard-coding.