From 621ed0d00ef1dd181388c068cf01a184805ecbb5 Mon Sep 17 00:00:00 2001 From: Steven Crawford Date: Fri, 1 Aug 2025 20:40:44 -0500 Subject: [PATCH] updates --- .DS_Store | Bin 0 -> 6148 bytes lua/.DS_Store | Bin 0 -> 6148 bytes lua/shelbybark/.DS_Store | Bin 0 -> 6148 bytes lua/shelbybark/plugins/codecompanion.lua | 77 ++++++++++++++++++ .../{plugins => unused-plugins}/avante.lua | 2 +- lua/shelbybark/unused-plugins/chatgpt.lua | 24 ++++++ 6 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 .DS_Store create mode 100644 lua/.DS_Store create mode 100644 lua/shelbybark/.DS_Store create mode 100644 lua/shelbybark/plugins/codecompanion.lua rename lua/shelbybark/{plugins => unused-plugins}/avante.lua (97%) create mode 100644 lua/shelbybark/unused-plugins/chatgpt.lua diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f9dedd3c9b4cbcb80cce64e47bfd75b0d554e1b7 GIT binary patch literal 6148 zcmeHK%SyvQ6rHivrW7Fyg)Rr&7EFCo+=N(vz=$qXYC?(zW2Q8TS(HN7`a^z+-{ZYA z6R?=Ih`kqP&V9~g4rCsTG42)7kTIJvWE zopYJyL7YzKsvwT0kaBkur;#i@S)@^>YJDBBx>k2$_ZN%d@##PeozZe27NY}aAdU`C zmdmcSySIOKIeAWAQu(Iod(_erjOvMv+FEEVt^PR28e<6X26^a zR&Tv&pw$xt#6SZBxIYMJh_1m(quM&4!|OA~+lVNj<68nz7<3I*8X*G0bt#}O<>raO zbvgKj$#V@>8g)72YGxS6%v?WSxSAdOLZvhAYNVbRAO=<$Xlc{N^Zx>VnZ`%{Y6)4y z05R~-7~t)(KlWfz=4}13JUnX!v5}BEg;3~k1n>$0_%MY2 zQZyU>A_KH{TaZ8xx)9;s&G#=zlR*%v0R11qAPSRFz5Xe3`NGC#(J4A*=fUf#)EoJu zankgMcQm?IDhg(OKe!3IX}hv>q2iGr#@(S#2s>R2xxWqLj!K(q9Cs3(>luera!Tz= zbuwujpVnlfem1Si$=N}@CXWtJrqhzMySIOS)$T{nv3fIv3jFu9Y+IbcJ9bvC?Zq3$ zk&2(tKg*rvFfs$o05h--4A`^JDX+s~d5z2fGw>q@=zNfS5T0$TO({YS3gT(OYsJ=9QM`m&U%-eSRBA&@4aRI~T5~9cJb=EC590GU zv%3MSJ$MqaGqC&3&d+YMGb^LZRmfA%-MKlTi>Y zndmQ?=-bOMf(WKCgiqhE0`$BEqbN)!_4>Og6iaLCWvA>^ojdS&ib9E4|(duD(cSY)7R zhAy4|=lIJkedI5u@Q4{;2L2fXqSWy_Z7j;3t>4O{vsPle$3{YN87U~JFI)m}K>NtH eb{fAV9pgNUnL(O`>^dEhF9Mnn?wEmJVBiB7o=q(P literal 0 HcmV?d00001 diff --git a/lua/shelbybark/plugins/codecompanion.lua b/lua/shelbybark/plugins/codecompanion.lua new file mode 100644 index 0000000..c2890c1 --- /dev/null +++ b/lua/shelbybark/plugins/codecompanion.lua @@ -0,0 +1,77 @@ +return { + { + "olimorris/codecompanion.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "j-hui/fidget.nvim", + }, + opts = { + strategies = { + chat = { + adapter = "openai", + }, + inline = { + adapter = "openai", + }, + }, + adapters = {}, + }, + config = function(_, opts) + local api_key = "" + local handle = io.popen("pass openai/api_key") + if handle then + api_key = handle:read("*a"):gsub("%s+$", "") + handle:close() + end + + opts.adapters.openai = function() + return require("codecompanion.adapters").extend("openai", { + env = { + api_key = api_key, + }, + }) + end + -- opts.adapters.openai = require("codecompanion.adapters").extend("openai", { + -- env = { + -- api_key = api_key, + -- }, + -- }) + + require("codecompanion").setup(opts) + + local progress = require("fidget.progress") + local handles = {} + local group = vim.api.nvim_create_augroup("CodeCompanionFidget", {}) + + vim.api.nvim_create_autocmd("User", { + pattern = "CodeCompanionRequestStarted", + group = group, + callback = function(e) + handles[e.data.id] = progress.handle.create({ + title = "CodeCompanion", + message = "Thinking...", + lsp_client = { name = e.data.adapter.formatted_name }, + }) + end, + }) + + vim.api.nvim_create_autocmd("User", { + pattern = "CodeCompanionRequestFinished", + group = group, + callback = function(e) + local h = handles[e.data.id] + if h then + h.message = e.data.status == "success" and "Done" or "Failed" + h:finish() + handles[e.data.id] = nil + end + end, + }) + end, + }, + { + "MeanderingProgrammer/render-markdown.nvim", + ft = { "markdown", "codecompanion" }, + }, +} diff --git a/lua/shelbybark/plugins/avante.lua b/lua/shelbybark/unused-plugins/avante.lua similarity index 97% rename from lua/shelbybark/plugins/avante.lua rename to lua/shelbybark/unused-plugins/avante.lua index 66f85b4..cd28712 100644 --- a/lua/shelbybark/plugins/avante.lua +++ b/lua/shelbybark/unused-plugins/avante.lua @@ -9,7 +9,7 @@ return { provider = "openai", providers = { openai = { - endpoint = "https://api.openai.com/v1", + endpoint = "https://api.openai.com/v1/responses", model = "gpt-4o", -- your desired model (or use gpt-4o, etc.) extra_request_body = { timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models diff --git a/lua/shelbybark/unused-plugins/chatgpt.lua b/lua/shelbybark/unused-plugins/chatgpt.lua new file mode 100644 index 0000000..10cc77a --- /dev/null +++ b/lua/shelbybark/unused-plugins/chatgpt.lua @@ -0,0 +1,24 @@ +return { + "jackMort/ChatGPT.nvim", + event = "VeryLazy", + config = function() + require("chatgpt").setup({ + -- this config assumes you have OPENAI_API_KEY environment variable set + openai_params = { + model = "gpt-4o", + frequency_penalty = 0, + presence_penalty = 0, + max_tokens = 4095, + temperature = 0.2, + top_p = 0.1, + n = 1, + }, + }) + end, + dependencies = { + "MunifTanjim/nui.nvim", + "nvim-lua/plenary.nvim", + "folke/trouble.nvim", -- optional + "nvim-telescope/telescope.nvim", + }, +}