refactor(web): drop hardcoded preset models for custom providers & fix handler bug

- Remove vendor-specific preset model lists for custom embedding/vision
  providers; users now type the model id manually (lists vary per vendor).
- Strip third-party vendor names from comments.
- Fix AttributeError in _set_vision/_set_embedding: the provider constants
  live on ModelsHandler, not ConfigHandler, so selecting a built-in
  provider crashed. Also replace the fragile [:-1] slice with an explicit
  non-custom filter.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zhayujie
2026-06-19 20:59:10 +08:00
parent 8ddfcbb125
commit 03ffa2db7d
2 changed files with 11 additions and 16 deletions

View File

@@ -145,9 +145,9 @@ EMBEDDING_VENDORS = {
# Custom provider — any OpenAI-compatible /embeddings endpoint. The
# user must supply api_key + api_base + model via the web console
# (stored in custom_providers list or legacy custom_api_key / custom_api_base).
# Dimensions defaults to 1024 (most Chinese vendors) but can be
# overridden via config's embedding_dimensions. No dim-param support
# assumption — safest default for unknown endpoints.
# Dimensions defaults to 1024 but can be overridden via config's
# embedding_dimensions. No dim-param support assumption — safest
# default for unknown endpoints.
"custom": {
"default_base_url": "",
"default_model": "",