local prefix = "C" return { { "jackMort/ChatGPT.nvim", dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", }, cond = function() local api_key = os.getenv("OPENAI_API_KEY") return api_key and api_key ~= "" and true or false end, opts = { edit_with_instructions = { diff = false, keymaps = { close = "", accept = "", toggle_diff = "", toggle_settings = "", cycle_windows = "", use_output_as_input = "", }, }, chat = { welcome_message = "", keymaps = { close = { "" }, yank_last = "", yank_last_code = "", scroll_up = "", scroll_down = "", new_session = "", cycle_windows = "", cycle_modes = "", next_message = "", prev_message = "", select_session = { "", "o", "" }, rename_session = "r", delete_session = "d", draft_message = "", edit_message = "e", delete_message = "d", toggle_settings = "", toggle_message_role = "", toggle_system_role_open = "", stop_generating = "", }, }, openai_params = { model = "gpt-3.5-turbo-16k", -- model = "gpt-4", frequency_penalty = 0, presence_penalty = 0, max_tokens = 300, temperature = 0.3, top_p = 0.3, n = 1, -- temperature = 0, -- top_p = 1, }, openai_edit_params = { model = "gpt-3.5-turbo-16k", -- model = "gpt-4", frequency_penalty = 0, presence_penalty = 0, temperature = 0, top_p = 1, n = 1, }, show_quickfixes_cmd = "Trouble quickfix", -- actions_paths = { "~/.config/nvim/custom_actions.json" }, }, cmd = { "ChatGPT", "ChatGPTActAs", "ChatGPTCompleteCode", "ChatGPTEditWithInstructions", "ChatGPTRun", }, -- stylua: ignore keys = { { prefix .. "c", "ChatGPT", desc = "ChatGPT" }, { prefix .. "e", "ChatGPTEditWithInstruction", desc = "Edit With Instruction", mode = { "n", "v" } }, { prefix .. "g", "ChatGPTRun grammar_correction", desc = "Grammar Correction", mode = { "n", "v" } }, { prefix .. "t", "ChatGPTRun translate", desc = "Translate", mode = { "n", "v" } }, { prefix .. "k", "ChatGPTRun keywords", desc = "Keywords", mode = { "n", "v" } }, { prefix .. "d", "ChatGPTRun docstring", desc = "Docstring", mode = { "n", "v" } }, { prefix .. "T", "ChatGPTRun add_tests", desc = "Add Tests", mode = { "n", "v" } }, { prefix .. "o", "ChatGPTRun optimize_code", desc = "Optimize Code", mode = { "n", "v" } }, { prefix .. "s", "ChatGPTRun summarize", desc = "Summarize", mode = { "n", "v" } }, { prefix .. "f", "ChatGPTRun fix_bugs", desc = "Fix Bugs", mode = { "n", "v" } }, { prefix .. "x", "ChatGPTRun explain_code", desc = "Explain Code", mode = { "n", "v" } }, { prefix .. "r", "ChatGPTRun roxygen_edit", desc = "Roxygen Edit", mode = { "n", "v" } }, { prefix .. "l", "ChatGPTRun code_readability_analysis", desc = "Code Readability Analysis", mode = { "n", "v" }, }, }, }, { "folke/which-key.nvim", opts = { spec = { { prefix, group = "chatGPT", icon = "󰚩 " }, }, }, }, }