2025-02-16 01:47:35 -08:00
|
|
|
return {
|
|
|
|
"olimorris/codecompanion.nvim",
|
|
|
|
dependencies = {
|
|
|
|
"nvim-lua/plenary.nvim",
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
|
|
|
"j-hui/fidget.nvim",
|
|
|
|
},
|
|
|
|
opts = {
|
2025-02-16 13:39:54 -08:00
|
|
|
adapters = {
|
|
|
|
copilot = function()
|
|
|
|
return require("codecompanion.adapters").extend("copilot", {
|
|
|
|
schema = {
|
2025-02-20 19:20:58 -08:00
|
|
|
name = "copilot",
|
2025-02-16 13:39:54 -08:00
|
|
|
model = {
|
2025-02-19 02:24:24 -08:00
|
|
|
default = "claude-3.5-sonnet",
|
|
|
|
-- default = "o3-mini-2025-01-31",
|
2025-02-16 13:39:54 -08:00
|
|
|
choices = {
|
|
|
|
["o3-mini-2025-01-31"] = { opts = { can_reason = true } },
|
|
|
|
["o1-2024-12-17"] = { opts = { can_reason = true } },
|
|
|
|
["o1-mini-2024-09-12"] = { opts = { can_reason = true } },
|
|
|
|
"claude-3.5-sonnet",
|
|
|
|
"gpt-4o-2024-08-06",
|
|
|
|
"gemini-2.0-flash-001",
|
|
|
|
},
|
|
|
|
},
|
2025-02-20 19:20:58 -08:00
|
|
|
-- max_tokens = {
|
|
|
|
-- default = 65536,
|
|
|
|
-- },
|
2025-02-16 13:39:54 -08:00
|
|
|
},
|
|
|
|
})
|
|
|
|
end,
|
2025-02-21 03:02:01 -08:00
|
|
|
llama_cpp = function()
|
|
|
|
return require("codecompanion.adapters").extend("openai_compatible", {
|
|
|
|
name = "llama-cpp",
|
|
|
|
schema = {
|
|
|
|
model = {
|
|
|
|
default = "qwen2.5-coder-14b-instruct",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
env = {
|
|
|
|
url = "http://localhost:8888",
|
|
|
|
chat_url = "/v1/chat/completions",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
end,
|
2025-02-16 13:39:54 -08:00
|
|
|
},
|
2025-02-16 01:47:35 -08:00
|
|
|
strategies = {
|
|
|
|
chat = {
|
|
|
|
adapter = "copilot",
|
2025-02-19 02:24:24 -08:00
|
|
|
roles = {
|
|
|
|
llm = " Assistant",
|
|
|
|
user = " User",
|
|
|
|
},
|
2025-02-16 14:14:13 -08:00
|
|
|
slash_commands = {
|
|
|
|
["file"] = {
|
|
|
|
opts = {
|
|
|
|
provider = "telescope",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["symbols"] = {
|
|
|
|
opts = {
|
|
|
|
provider = "telescope",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["buffer"] = {
|
|
|
|
opts = {
|
|
|
|
provider = "telescope",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
["terminal"] = {
|
|
|
|
opts = {
|
|
|
|
provider = "telescope",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2025-02-16 01:47:35 -08:00
|
|
|
},
|
|
|
|
inline = {
|
|
|
|
adapter = "copilot",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
display = {
|
|
|
|
action_palette = {
|
2025-02-16 13:39:54 -08:00
|
|
|
provider = "telescope",
|
|
|
|
width = 75,
|
|
|
|
heigth = 45,
|
2025-02-16 01:47:35 -08:00
|
|
|
},
|
|
|
|
chat = {
|
|
|
|
layout = "vertical",
|
|
|
|
border = "single",
|
2025-02-16 13:39:54 -08:00
|
|
|
intro_message = "Welcome to CodeCompanion ✨! Press ? for options",
|
|
|
|
show_header_separator = false, -- Show header separators in the chat buffer? Set this to false if you're using an external markdown formatting plugin
|
|
|
|
separator = "─", -- The separator between the different messages in the chat buffer
|
|
|
|
show_references = true, -- Show references (from slash commands and variables) in the chat buffer?
|
2025-02-20 19:20:58 -08:00
|
|
|
show_settings = false, -- Show LLM settings at the top of the chat buffer?
|
2025-02-16 13:39:54 -08:00
|
|
|
show_token_count = true, -- Show the token count for each response?
|
|
|
|
start_in_insert_mode = false, -- Open the chat buffer in insert mode?
|
2025-02-16 01:47:35 -08:00
|
|
|
},
|
|
|
|
diff = {
|
|
|
|
enabled = true,
|
|
|
|
provider = "mini_diff",
|
|
|
|
},
|
|
|
|
},
|
2025-02-19 02:24:24 -08:00
|
|
|
opts = {
|
|
|
|
-- log_level = "DEBUG",
|
|
|
|
log_level = "TRACE",
|
|
|
|
},
|
2025-02-16 01:47:35 -08:00
|
|
|
},
|
|
|
|
init = function()
|
|
|
|
require("plugins.codecompanion.fidget-spinner"):init()
|
|
|
|
end,
|
|
|
|
}
|