Skip to content

Commit ac76258

Browse files
committed
fix: list remote and local models
1 parent 83ac1da commit ac76258

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

lua/codegpt/models.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ function M.select_model()
161161
-- get local defined models
162162
local used_provider = vim.fn.tolower(Config.opts.connection.api_provider)
163163
local local_models = M.get_local_models(used_provider)
164-
models = vim.tbl_extend("force", models, local_models)
164+
models = vim.fn.extend(models, local_models)
165165

166166
if models == nil then
167167
error("listing models")

lua/codegpt/providers/ollama.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,7 @@ function M.get_models()
201201
error("Could not parse the response from " .. url .. "/v1/models")
202202
return {}
203203
end
204-
-- print(vim.inspect(json))
205-
local models = {}
206-
for _, model in ipairs(json.models) do
207-
table.insert(models, 0, model)
208-
end
204+
local models = vim.fn.extend({}, json.models)
209205
return models
210206
end
211207

0 commit comments

Comments
 (0)