fix: list copilot models (#2115)

This commit is contained in:
yetone
2025-06-02 22:58:41 +08:00
committed by GitHub
parent 647a459a2b
commit 3c47ebf971
2 changed files with 26 additions and 20 deletions

View File

@@ -30,7 +30,7 @@ local curl = require("plenary.curl")
local Config = require("avante.config")
local Path = require("plenary.path")
local Utils = require("avante.utils")
local P = require("avante.providers")
local Providers = require("avante.providers")
local OpenAI = require("avante.providers").openai
local H = {}
@@ -271,7 +271,7 @@ function M:parse_curl_args(prompt_opts)
-- (this should rarely happen, as we refresh the token in the background)
H.refresh_token(false, false)
local provider_conf, request_body = P.parse_config(self)
local provider_conf, request_body = Providers.parse_config(self)
local disable_tools = provider_conf.disable_tools or false
local tools = {}
@@ -347,6 +347,11 @@ end
M._is_setup = false
function M.is_env_set()
local ok = pcall(function() H.get_oauth_token() end)
return ok
end
function M.setup()
local copilot_token_file = Path:new(copilot_path)