From cf9da7869b61ded8cc95b418dea5ec2a61cf6fdc Mon Sep 17 00:00:00 2001 From: 0xTux <0xtux@pm.me> Date: Fri, 27 Sep 2024 23:51:56 +0530 Subject: [PATCH] replace gen.nvim with avante.nvim --- pkgs/nvim/nvim/lua/configs/avante.lua | 30 +++++++++++++++++++++++++++ pkgs/nvim/nvim/lua/configs/gen.lua | 12 ----------- pkgs/nvim/nvim/lua/plugins/init.lua | 14 +++++++++++-- 3 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 pkgs/nvim/nvim/lua/configs/avante.lua delete mode 100644 pkgs/nvim/nvim/lua/configs/gen.lua diff --git a/pkgs/nvim/nvim/lua/configs/avante.lua b/pkgs/nvim/nvim/lua/configs/avante.lua new file mode 100644 index 0000000..a382883 --- /dev/null +++ b/pkgs/nvim/nvim/lua/configs/avante.lua @@ -0,0 +1,30 @@ +local opts = { + provider = "ollama", + vendors = { + ollama = { + ["local"] = true, + endpoint = "100.64.0.1:11434/v1", + model = "deepseek-coder-v2", + parse_curl_args = function(opts, code_opts) + return { + url = opts.endpoint .. "/chat/completions", + headers = { + ["Accept"] = "application/json", + ["Content-Type"] = "application/json", + }, + body = { + model = opts.model, + messages = require("avante.providers").copilot.parse_message(code_opts), + max_tokens = 2048, + stream = true, + }, + } + end, + parse_response_data = function(data_stream, event_state, opts) + require("avante.providers").openai.parse_response(data_stream, event_state, opts) + end, + }, + }, +} + +return opts diff --git a/pkgs/nvim/nvim/lua/configs/gen.lua b/pkgs/nvim/nvim/lua/configs/gen.lua deleted file mode 100644 index 00cf36b..0000000 --- a/pkgs/nvim/nvim/lua/configs/gen.lua +++ /dev/null @@ -1,12 +0,0 @@ -local opts = { - model = "deepseek-coder-v2:latest", - host = "100.64.0.1", - port = "11434", - display_mode = "split", - show_prompt = true, - show_model = true, - no_auto_close = false, - debug = false, -} - -return opts diff --git a/pkgs/nvim/nvim/lua/plugins/init.lua b/pkgs/nvim/nvim/lua/plugins/init.lua index 593629f..612ee07 100644 --- a/pkgs/nvim/nvim/lua/plugins/init.lua +++ b/pkgs/nvim/nvim/lua/plugins/init.lua @@ -26,11 +26,21 @@ local plugins = { }, }, { - "David-Kunz/gen.nvim", + "yetone/avante.nvim", + event = "VeryLazy", lazy = false, + version = false, + build = "make", opts = function() - return require("configs.gen") + return require("configs.avante") end, + dependencies = { + "nvim-treesitter/nvim-treesitter", + "stevearc/dressing.nvim", + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", + }, }, { "Shatur/neovim-session-manager",