branch: externals/minuet
commit 2047854b0299402b533cb74750df67ce60fd27af
Author: Milan Glacier <[email protected]>
Commit: Milan Glacier <[email protected]>
refactor: get provider list from defcustom property in configuration wizard
dynamically.
Instead of hardcoding the list of supported providers in
`minuet-configure-provider`, derive the list directly from the
`minuet-provider` custom type definition.
This ensures that the configuration command automatically stays in
sync with available providers defined elsewhere in the codebase,
preventing the hardcoded list from becoming stale when new providers
are added.
---
minuet.el | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/minuet.el b/minuet.el
index 22385564ac..09ecebb817 100644
--- a/minuet.el
+++ b/minuet.el
@@ -1391,14 +1391,9 @@ settings, as an alternative to manual configuration via
`setq' and
`openai-fim-compatible' providers, users will be prompted to specify
their endpoint and API key."
(interactive)
- (let* ((providers '(("OpenAI" . openai)
- ("Claude" . claude)
- ("Codestral" . codestral)
- ("OpenAI Compatible" . openai-compatible)
- ("OpenAI FIM Compatible" . openai-fim-compatible)
- ("Gemini" . gemini)))
+ (let* ((providers (mapcar #'cddr (cdr (get 'minuet-provider 'custom-type))))
(provider-name (completing-read "Select provider: " providers nil t))
- (provider (alist-get provider-name providers nil nil #'equal))
+ (provider (car (alist-get provider-name providers nil nil #'equal)))
(options-sym (intern (format "minuet-%s-options" provider)))
(options (symbol-value options-sym))
(current-model (plist-get options :model))