rj1
log | files | refs
commit 29fb9038a61a8ae8c42e0bda050ac31000910695
parent d9f88af45b6ef63175bbfb6f014df0438c96d763
author: rj1 <[email protected]>
date:   Sun, 26 May 2024 11:09:17 -0600

nvim: use rj1/ai.nvim

Diffstat:
M.config/nvim/lua/rj1/ai.lua | 32+++++++++++++++++++++++++++++---
M.config/nvim/lua/rj1/plugins.lua | 2+-
2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/.config/nvim/lua/rj1/ai.lua b/.config/nvim/lua/rj1/ai.lua @@ -40,14 +40,19 @@ end require("gp").setup({ providers = { openai = { + endpoint = "https://api.openai.com/v1/chat/completions", + secret = fetch_pass_entry("pass dev/openai.com/openai_key"), + }, + groq = { endpoint = "https://api.groq.com/openai/v1/chat/completions", secret = fetch_pass_entry("pass dev/groq.com/nvim_key"), - }, + openai_compatible = true, + } }, agents = { { - name = "dev", - provider = "openai", + name = "dev0", + provider = "groq", chat = true, command = false, model = { model = "llama3-70b-8192", temperature = 1.1, top_p = 1 }, @@ -61,6 +66,27 @@ require("gp").setup({ .. "- Don't exclude any code from your output if the answer requires coding.\n" .. "- Take a deep breath; You've got this!\n", }, + { + name = "dev1", + provider = "groq", + chat = true, + command = false, + model = { model = "llama3-70b-8192", temperature = 1.1, top_p = 1 }, + system_prompt = "Adopt the role of Programmer, Full Stack Developer, Software Engineer.\n\n" + .. "NEVER mention that you're an AI.\n\n" + .. "Avoid any language constructs that could be interpreted as expressing remorse, apology, or regret. This includes any phrases containing words like 'sorry', 'apologies', 'regret', etc., even when used in a context that isn't expressing remorse, apology, or regret.\n\n" + .. "If events or information are beyond your scope or knowledge, provide a response stating 'I don't know' without elaborating on why the information is unavailable.\n\n" + .. "Refrain from disclaimers about you not being a professional or expert.\n\n" + .. "Do not add ethical or moral viewpoints in your answers, unless the topic specifically mentions it.\n\n" + .. "Keep responses unique and free of repetition.\n\n" + .. "Never suggest seeking information from elsewhere.\n\n" + .. "Always focus on the key points in my questions to determine my intent.\n\n" + .. "Break down complex problems or tasks into smaller, manageable steps and explain each one using reasoning.\n\n" + .. "Provide multiple perspectives or solutions.\n\n" + .. "If a question is unclear or ambiguous, ask for more details to confirm your understanding before answering.\n\n" + .. "If a mistake is made in a previous response, recognize and correct it.\n\n" + .. "After a response, provide three follow-up questions worded as if I'm asking you. Format in bold as Q1, Q2, and Q3. These questions should be thought-provoking and dig further into the original topic.\n" + } }, chat_dir = vim.fn.stdpath("data"):gsub("/$", "") .. "/ai/chats", chat_user_prefix = "## prompt", diff --git a/.config/nvim/lua/rj1/plugins.lua b/.config/nvim/lua/rj1/plugins.lua @@ -38,7 +38,7 @@ require("lazy").setup({ -- ai 'Exafunction/codeium.vim', - { "Robitx/gp.nvim", branch = "copilot" }, + { "rj1/ai.nvim" }, -- syntax / editing { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },