plugins/parrot: init

This commit is contained in:
Gaetan Lepage 2025-04-11 17:35:33 +02:00 committed by nix-infra-bot
parent 16879e3034
commit 327d491936
2 changed files with 141 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{ lib, ... }:
lib.nixvim.plugins.mkNeovimPlugin {
name = "parrot";
packPathName = "parrot.nvim";
package = "parrot-nvim";
maintainers = [ lib.maintainers.GaetanLepage ];
extraConfig = {
dependencies.ripgrep.enable = lib.mkDefault true;
};
settingsExample = lib.literalExpression ''
{
cmd_prefix = "Parrot";
providers = {
github = {
api_key.__raw = "os.getenv 'GITHUB_TOKEN'";
topic.model = "gpt-4o";
};
};
hooks = {
Ask.__raw = '''
function(parrot, params)
local template = "Please, answer to this question: {{command}}."
local model_obj = parrot.get_model("command")
parrot.logger.info("Asking model: " .. model_obj.name)
parrot.Prompt(params, parrot.ui.Target.popup, model_obj, "🤖 Ask ~ ", template)
end
''';
};
};
'';
}