Skip to content

Commit 0d19b49

Browse files
authored
refactor(adapters): improve model list ui (#2428)
Co-authored-by: Oli Morris <[email protected]>
1 parent e400396 commit 0d19b49

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lua/codecompanion/adapters/http/copilot/get_models.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ local function fetch_async(adapter, provided_token)
151151
billing.multiplier = model.billing.multiplier
152152
end
153153

154+
local description = model.name .. (billing.multiplier and (" (" .. billing.multiplier .. "x)") or "")
155+
154156
models[model.id] = {
155157
billing = billing,
158+
description = description,
156159
endpoint = internal_endpoint,
157160
formatted_name = model.name,
158161
limits = limits,

lua/codecompanion/strategies/chat/keymaps/change_adapter.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ function M.select_model(chat)
183183
local display
184184

185185
if type(model) == "table" then
186-
display = model.formatted_name or model.id or "Unknown"
187-
if model.billing and model.billing.multiplier then
188-
display = string.format("%-30s │ %sx", display, model.billing.multiplier)
189-
end
186+
display = model.description or model.formatted_name or model.id or "Unknown"
190187
else
191188
display = model
192189
end

0 commit comments

Comments
 (0)