feat: hide in model selector (#1574)

This commit is contained in:
yetone
2025-03-13 01:39:59 +08:00
committed by GitHub
parent d422cfabcd
commit d307467771
3 changed files with 6 additions and 1 deletions

View File

@@ -574,6 +574,7 @@ M.BASE_PROVIDER_KEYS = {
"__inherited_from",
"disable_tools",
"entra",
"hide_in_model_selector",
}
return M

View File

@@ -21,8 +21,11 @@ function M.open()
-- Collect models from main providers and vendors
for _, provider_name in ipairs(Config.provider_names) do
local entry = create_model_entry(provider_name, Config.get_provider_config(provider_name))
local cfg = Config.get_provider_config(provider_name)
if cfg.hide_in_model_selector then goto continue end
local entry = create_model_entry(provider_name, cfg)
if entry then table.insert(models, entry) end
::continue::
end
if #models == 0 then

View File

@@ -205,6 +205,7 @@ vim.g.avante_login = vim.g.avante_login
---@field _shellenv? string
---@field disable_tools? boolean
---@field entra? boolean
---@field hide_in_model_selector? boolean
---
---@class AvanteSupportedProvider: AvanteDefaultBaseProvider
---@field __inherited_from? string