CodeCompanion test
This commit is contained in:
@ -160,43 +160,15 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
'gsuuon/model.nvim',
|
||||
config = function()
|
||||
local bash_provider = {
|
||||
request_completion = function(handlers, params, options)
|
||||
local input = params.input
|
||||
local command = "~/test '" .. input .. "'"
|
||||
local handle = io.popen(command)
|
||||
local result = handle:read("*a")
|
||||
handle:close()
|
||||
|
||||
local response = vim.json.decode(result)
|
||||
handlers.on_partial(response.message.content)
|
||||
handlers.on_finish()
|
||||
end
|
||||
}
|
||||
|
||||
require('model').setup({
|
||||
chats = {
|
||||
mybash = {
|
||||
provider = bash_provider,
|
||||
create = function(input, context)
|
||||
return {
|
||||
messages = {
|
||||
{ role = 'user', content = input }
|
||||
}
|
||||
}
|
||||
end,
|
||||
run = function(messages, config)
|
||||
local last_message = messages[#messages]
|
||||
return { input = last_message.content }
|
||||
end
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
"olimorris/codecompanion.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("config.codecompanion")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user