✨ feat(ai/avante): add dynamic provider configuration generation and extend copilot settings
This commit is contained in:
1 file changed
+26
-20
+26
-20
@@ -13,32 +13,38 @@ local model_names = {
|
|||||||
'o4-mini',
|
'o4-mini',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Generate provider configurations for each model
|
||||||
|
local function generate_providers()
|
||||||
|
local providers_table = {}
|
||||||
|
for _, model_name in ipairs(model_names) do
|
||||||
|
local provider_key = 'copilot-' .. model_name
|
||||||
|
providers_table[provider_key] = {
|
||||||
|
__inherited_from = 'copilot',
|
||||||
|
model = model_name,
|
||||||
|
display_name = provider_key,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return providers_table
|
||||||
|
end
|
||||||
|
|
||||||
avante.setup({
|
avante.setup({
|
||||||
mode = 'agentic',
|
mode = 'agentic',
|
||||||
provider = 'copilot-claude-3.5-sonnet',
|
provider = 'copilot-claude-3.5-sonnet',
|
||||||
-- cursor_applying_provider = 'copilot-o3-mini',
|
-- cursor_applying_provider = 'copilot-o3-mini',
|
||||||
-- auto_suggestions_provider = 'copilot-claude-3.7-sonnet',
|
-- auto_suggestions_provider = 'copilot-claude-3.7-sonnet',
|
||||||
copilot = {
|
|
||||||
endpoint = 'https://api.githubcopilot.com',
|
|
||||||
allow_insecure = false,
|
|
||||||
timeout = 10 * 60 * 1000,
|
|
||||||
temperature = 0,
|
|
||||||
max_completion_tokens = 1000000,
|
|
||||||
reasoning_effort = 'high',
|
|
||||||
},
|
|
||||||
|
|
||||||
vendors = (function()
|
providers = vim.tbl_extend('force', {
|
||||||
local vendors_table = {}
|
copilot = {
|
||||||
for _, model_name in ipairs(model_names) do
|
endpoint = 'https://api.githubcopilot.com',
|
||||||
local vendor_key = 'copilot-' .. model_name
|
allow_insecure = false,
|
||||||
vendors_table[vendor_key] = {
|
timeout = 10 * 60 * 1000,
|
||||||
__inherited_from = 'copilot',
|
extra_request_body = {
|
||||||
model = model_name,
|
temperature = 0,
|
||||||
display_name = vendor_key,
|
},
|
||||||
}
|
max_completion_tokens = 1000000,
|
||||||
end
|
reasoning_effort = 'high',
|
||||||
return vendors_table
|
},
|
||||||
end)(),
|
}, generate_providers()),
|
||||||
|
|
||||||
behaviour = {
|
behaviour = {
|
||||||
auto_suggestions = false,
|
auto_suggestions = false,
|
||||||
|
|||||||
Reference in new issue
Block a user