fix nvim: upgrade avante.nvim and update providers format. and fix ollama api key

Provider configuration migration guide: <https://github.com/yetone/avante.nvim/wiki/Provider-configuration-migration-guide>
This commit is contained in:
Yuan Chiu 2025-06-03 23:14:19 +08:00
parent 7ef8a4275d
commit fa8b671872
Signed by: yuan
GPG Key ID: 50FBE4156404B98D

View File

@ -30,16 +30,23 @@ return {
{ "<C-A-i>", "<cmd>AvanteToggle<cr>", desc = "Avante Chat Toggle" }, { "<C-A-i>", "<cmd>AvanteToggle<cr>", desc = "Avante Chat Toggle" },
}, },
opts = { opts = {
provider = "ollama", providers = {
ollama = { ollama = {
{{ if .ollamaKey -}} {{ if .ollamaKey -}}
api_key_name = "OLLAMA_API_KEY", api_key_name = "OLLAMA_API_KEY",
{{ end -}} {{ end -}}
endpoint = {{ .ollamaUrl | quote }}, endpoint = {{ .ollamaUrl | quote }},
model = "qwen2.5-coder:7b", model = "qwen2.5-coder:7b",
disable_tools = true, -- Open-source models often do not support tools. disable_tools = true, -- Open-source models often do not support tools.
-- Fix: Always show `ollama: API key not set, continuing without authentication`
parse_api_key = function()
return vim.env.OLLAMA_API_KEY
end,
},
}, },
provider = "ollama",
behaviour = { behaviour = {
auto_suggestions = false, -- Experimental stage auto_suggestions = false, -- Experimental stage
auto_set_highlight_group = true, auto_set_highlight_group = true,