mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/parrot: init
This commit is contained in:
parent
16879e3034
commit
327d491936
2 changed files with 141 additions and 0 deletions
34
plugins/by-name/parrot/default.nix
Normal file
34
plugins/by-name/parrot/default.nix
Normal 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
|
||||
''';
|
||||
};
|
||||
};
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue