2025-04-14 15:20:54 +01:00
|
|
|
require('helpers').edit_cf('pa', '/lua/plugins/codecompanion.lua')
|
2025-04-14 11:38:42 +01:00
|
|
|
|
2025-04-29 17:22:28 +01:00
|
|
|
vim.cmd [[cab cc CodeCompanion]]
|
|
|
|
|
|
2025-04-13 22:53:08 +01:00
|
|
|
return {
|
|
|
|
|
'olimorris/codecompanion.nvim',
|
2025-04-15 20:48:35 +01:00
|
|
|
opts = function(_, opts)
|
|
|
|
|
opts.adapters = {
|
2025-04-17 08:53:20 +01:00
|
|
|
gpt = function()
|
2025-04-14 15:20:54 +01:00
|
|
|
return require('codecompanion.adapters').extend('copilot', {
|
|
|
|
|
schema = {
|
|
|
|
|
model = {
|
2025-04-15 20:48:35 +01:00
|
|
|
default = 'gpt-4o',
|
2025-04-14 15:20:54 +01:00
|
|
|
},
|
2025-04-17 08:53:20 +01:00
|
|
|
max_tokens = {
|
|
|
|
|
default = 1000000,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
end,
|
|
|
|
|
flash = function()
|
|
|
|
|
return require('codecompanion.adapters').extend('copilot', {
|
|
|
|
|
schema = {
|
|
|
|
|
model = {
|
|
|
|
|
default = 'gemini-2.0-flash',
|
|
|
|
|
},
|
|
|
|
|
max_tokens = {
|
|
|
|
|
default = 1000000,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
end,
|
|
|
|
|
gemini = function()
|
|
|
|
|
return require('codecompanion.adapters').extend('copilot', {
|
|
|
|
|
schema = {
|
|
|
|
|
model = {
|
|
|
|
|
default = 'gemini-2.5-pro',
|
|
|
|
|
},
|
|
|
|
|
max_tokens = {
|
|
|
|
|
default = 1000000,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
end,
|
|
|
|
|
sonnet = function()
|
|
|
|
|
return require('codecompanion.adapters').extend('copilot', {
|
|
|
|
|
schema = {
|
|
|
|
|
model = {
|
|
|
|
|
default = 'claude-3.7-sonnet',
|
|
|
|
|
},
|
|
|
|
|
max_tokens = {
|
|
|
|
|
default = 1000000,
|
|
|
|
|
},
|
2025-04-14 15:20:54 +01:00
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
end,
|
2025-04-15 20:48:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opts.display = {
|
2025-04-14 15:20:54 +01:00
|
|
|
chat = {
|
|
|
|
|
show_settings = true,
|
|
|
|
|
},
|
2025-04-15 20:48:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opts.strategies = {
|
|
|
|
|
chat = {
|
2025-04-29 17:22:28 +01:00
|
|
|
adapter = 'gpt',
|
2025-04-15 20:48:35 +01:00
|
|
|
slash_commands = {
|
|
|
|
|
codebase = require('vectorcode.integrations').codecompanion.chat.make_slash_command(),
|
|
|
|
|
},
|
|
|
|
|
tools = {
|
|
|
|
|
vectorcode = {
|
|
|
|
|
description = 'Run VectorCode to retrieve the project context.',
|
|
|
|
|
callback = require('vectorcode.integrations').codecompanion.chat.make_tool(),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-04-17 08:53:20 +01:00
|
|
|
inline = {
|
|
|
|
|
adapter = 'flash',
|
|
|
|
|
},
|
2025-04-15 20:48:35 +01:00
|
|
|
}
|
|
|
|
|
end,
|
2025-04-13 22:53:08 +01:00
|
|
|
dependencies = {
|
|
|
|
|
'nvim-lua/plenary.nvim',
|
|
|
|
|
'nvim-treesitter/nvim-treesitter',
|
2025-04-15 20:48:35 +01:00
|
|
|
'Davidyz/VectorCode',
|
2025-04-13 22:53:08 +01:00
|
|
|
},
|
|
|
|
|
}
|