feature model selection custom display name (#1477)

* feature model selection custom display name

Added an option for a custom display name
I had the need for this option for multiple similar custom model
configurations where I wanted to have more indicative titles.

* linting error
This commit is contained in:
Grimaldi Baptiste
2025-03-05 11:25:48 +00:00
committed by GitHub
parent 7919fe010b
commit 232d4b1340
3 changed files with 8 additions and 5 deletions

View File

@@ -537,6 +537,7 @@ M.BASE_PROVIDER_KEYS = {
"allow_insecure",
"api_key_name",
"timeout",
"display_name",
-- internal
"local",
"_shellenv",

View File

@@ -8,11 +8,12 @@ local M = {}
---@param cfg table
---@return table?
local function create_model_entry(provider, cfg)
return cfg.model and {
name = provider .. "/" .. cfg.model,
provider = provider,
model = cfg.model,
}
return cfg.model
and {
name = cfg.display_name or (provider .. "/" .. cfg.model),
provider = provider,
model = cfg.model,
}
end
function M.open()

View File

@@ -215,6 +215,7 @@ vim.g.avante_login = vim.g.avante_login
---@field temperature? number
---@field max_tokens? number
---@field reasoning_effort? string
---@field display_name? string
---
---@class AvanteLLMUsage
---@field input_tokens number