configure some AI agents

This commit is contained in:
Lucas Garcia Rubio 2025-05-09 09:14:47 -03:00
parent 9f8d2f1019
commit b903bc371f
6 changed files with 90 additions and 21 deletions

View file

@ -7,12 +7,41 @@ return {
'nvim-treesitter/nvim-treesitter',
},
opts = {
display = {
chat = {
show_settings = true,
},
},
extensions = {
mcphub = {
callback = 'mcphub.extensions.codecompanion',
opts = {
make_vars = true,
make_slash_commands = true,
show_result_in_chat = true,
},
},
},
adapters = {
copilot = function()
return require('codecompanion.adapters').extend('copilot', {
schema = {
model = {
default = 'gpt-4o',
},
},
})
end,
},
strategies = {
chat = {
adapter = 'openai',
adapter = 'copilot',
},
inline = {
adapter = 'openai',
adapter = 'copilot',
},
cmd = {
adapter = 'copilot',
},
},
prompt_library = {
@ -34,13 +63,13 @@ return {
vim.g.codecompanion_auto_tool_mode = true
return [[### Steps to Follow
You are required to create a Pull Request description based on the file at .github/pull_request_template.md. You must use @cmd_runner to read that file.
You are required to create a Pull Request description based on the file at .github/pull_request_template.md. You must use @cmd_runner to read that file.
1. The file is in Portuguese, so you must complete the description in Portuguese as well.
2. Use @cmd_runner to get the git diff of the current branch, by using the command `git diff origin/HEAD`.
3. Based on that diff, you will generate a Pull Request description based on .github/pull_request_template.md.
4. If necessary, you can obtain the name of the branch by using the command `git rev-parse --abbrev-ref HEAD`.
5. Write the entire pull request description.]]
1. The file is in Portuguese, so you must complete the description in Portuguese as well.
2. Use @cmd_runner to get the git diff of the current branch, by using the command `git diff origin/HEAD`.
3. Based on that diff, you will generate a Pull Request description based on .github/pull_request_template.md.
4. If necessary, you can obtain the name of the branch by using the command `git rev-parse --abbrev-ref HEAD`.
5. Write the entire pull request description.]]
end,
},
},

View file

@ -1,11 +0,0 @@
return {
-- {
-- 'CopilotC-Nvim/CopilotChat.nvim',
-- dependencies = {
-- { 'zbirenbaum/copilot.lua' }, -- or zbirenbaum/copilot.lua
-- { 'nvim-lua/plenary.nvim', branch = 'master' }, -- for curl, log and async functions
-- },
-- build = 'make tiktoken', -- Only on MacOS or Linux
-- opts = {},
-- },
}

View file

@ -0,0 +1,23 @@
return {
-- {
-- 'CopilotC-Nvim/CopilotChat.nvim',
-- dependencies = {
-- -- { 'zbirenbaum/copilot.lua' }, -- or zbirenbaum/copilot.lua
-- { 'github/copilot.vim' },
-- { 'nvim-lua/plenary.nvim', branch = 'master' }, -- for curl, log and async functions
-- },
-- build = 'make tiktoken', -- Only on MacOS or Linux
-- opts = {},
-- -- config = function()
-- -- require('copilot').setup {
-- -- suggestion = {
-- -- enabled = false,
-- -- auto_trigger = true,
-- -- keymap = {
-- -- accept = '<Tab>',
-- -- },
-- -- },
-- -- }
-- -- end,
-- },
}

View file

@ -0,0 +1,25 @@
return {
'ravitemer/mcphub.nvim',
dependencies = {
'nvim-lua/plenary.nvim', -- Required for Job and HTTP requests
},
-- uncomment the following line to load hub lazily
--cmd = "MCPHub", -- lazy load
build = 'npm install -g mcp-hub@latest', -- Installs required mcp-hub npm module
-- uncomment this if you don't want mcp-hub to be available globally or can't use -g
-- build = "bundled_build.lua", -- Use this and set use_bundled_binary = true in opts (see Advanced configuration)
config = function()
require('mcphub').setup {
extensions = {
codecompanion = {
-- Show the mcp tool result in the chat buffer
show_result_in_chat = true,
-- Make chat #variables from MCP server resources
make_vars = true,
-- Create slash commands for prompts
make_slash_commands = true,
},
},
}
end,
}