From 91f5850c3cdd1566a0fd4c1ef7de569071b28d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Tue, 28 Jan 2025 09:40:48 -0300 Subject: [PATCH] Update lua/lazyvim/plugins/extras/ai/avante.lua Co-authored-by: PatMulligan <43773168+PatMulligan@users.noreply.github.com> --- lua/lazyvim/plugins/extras/ai/avante.lua | 50 ++++++++---------------- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/avante.lua b/lua/lazyvim/plugins/extras/ai/avante.lua index 3bd1c535..eb249859 100644 --- a/lua/lazyvim/plugins/extras/ai/avante.lua +++ b/lua/lazyvim/plugins/extras/ai/avante.lua @@ -5,45 +5,27 @@ return { dependencies = { "stevearc/dressing.nvim", }, - opts = function(_, opts) + opts = { -- Default configuration - opts.hints = { enabled = false } + hints = { enabled = false }, + + ---@alias AvanteProvider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string + provider = "claude", -- Recommend using Claude + auto_suggestions_provider = "claude", -- Since auto-suggestions are a high-frequency operation and therefore expensive, it is recommended to specify an inexpensive provider or even a free provider: copilot + claude = { + endpoint = "https://api.anthropic.com", + model = "claude-3-5-sonnet-20241022", + temperature = 0, + max_tokens = 4096, + }, -- File selector configuration --- @alias FileSelectorProvider "native" | "fzf" | "mini.pick" | "snacks" | "telescope" | string - opts.file_selector = { - provider = "fzf", + file_selector = { + provider = "fzf", -- Avoid native provider issues provider_opts = {}, - } - - -- Blink.cmp integration - -- LSP score_offset is typically 60 - opts.providers = { - avante_commands = { - name = "avante_commands", - module = "blink.compat.source", - score_offset = 90, -- show at a higher priority than lsp - opts = {}, - }, - avante_files = { - name = "avante_files", - module = "blink.compat.source", - score_offset = 100, -- show at a higher priority than lsp - opts = {}, - }, - avante_mentions = { - name = "avante_mentions", - module = "blink.compat.source", - score_offset = 1000, -- show at a higher priority than lsp - opts = {}, - }, - } - opts.compat = { - "avante_commands", - "avante_mentions", - "avante_files", - } - end, + }, + }, build = LazyVim.is_win() and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" or "make", }, {