nixvim: add codecompanion
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m19s
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m19s
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
osConfig,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@@ -82,6 +83,57 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugins.codecompanion = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
adapters = {
|
||||||
|
http.opts.show_defaults = false;
|
||||||
|
openwebui.__raw = ''
|
||||||
|
function()
|
||||||
|
return require("codecompanion.adapters").extend("openai_compatible", {
|
||||||
|
name = "openwebui",
|
||||||
|
formatted_name = "Open WebUI",
|
||||||
|
opts = {
|
||||||
|
stream = true,
|
||||||
|
tools = true,
|
||||||
|
vision = false,
|
||||||
|
},
|
||||||
|
url = "''${url}''${chat_endpoint}",
|
||||||
|
env = {
|
||||||
|
api_key = "cmd:cat ${osConfig.age.secrets.open-webui-api-key.path}",
|
||||||
|
url = "https://chat.ai.vimium.com",
|
||||||
|
chat_endpoint = "/api/chat/completions",
|
||||||
|
models_endpoint = "/api/models",
|
||||||
|
},
|
||||||
|
headers = {
|
||||||
|
["Content-Type"] = "application/json",
|
||||||
|
Authorization = "Bearer ''${api_key}",
|
||||||
|
},
|
||||||
|
schema = {
|
||||||
|
model = {
|
||||||
|
default = "openai/gpt-5-chat",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
strategies = {
|
||||||
|
chat = {
|
||||||
|
adapter = "openwebui";
|
||||||
|
};
|
||||||
|
inline = {
|
||||||
|
adapter = "openwebui";
|
||||||
|
};
|
||||||
|
cmd = {
|
||||||
|
adapter = "openwebui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
plugins.telescope = {
|
plugins.telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
keymaps = {
|
keymaps = {
|
||||||
@@ -126,6 +178,8 @@
|
|||||||
# plugins.none-ls.enable = true;
|
# plugins.none-ls.enable = true;
|
||||||
# plugins.nvim-tree.enable = true;
|
# plugins.nvim-tree.enable = true;
|
||||||
# plugins.oil.enable = true;
|
# plugins.oil.enable = true;
|
||||||
|
# plugins.persisted.enable = true;
|
||||||
|
# plugins.precognition.enable = true;
|
||||||
# plugins.project-nvim.enable = true;
|
# plugins.project-nvim.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user