added code companion

This commit is contained in:
2025-06-08 19:25:11 -05:00
parent e974ccd7eb
commit 7456a1e684

View File

@@ -0,0 +1,44 @@
return {
"olimorris/codecompanion.nvim",
lazy = true,
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
},
opts = {
strategies = {
chat = {
adapter = "ollama",
},
inline = {
adapter = "ollama",
},
cmd = {
adapter = "ollama",
},
},
adapters = {
ollama = function()
return require("codecompanion.adapters").extend("ollama", {
env = {
url = "http://10.72.2.200:11434",
-- api_key = "OLLAMA_API_KEY",
schema = {
model = {
default = "qwen2.5-coder:latest",
},
},
},
headers = {
["Content-Type"] = "application/json",
-- ["Authorization"] = "Bearer ${api_key}",
},
parameters = {
sync = true,
},
})
end,
},
},
}