assistant/codecompanion-nvim: allow adapter to be specified by name and model

This commit is contained in:
jasg 2026-01-19 20:47:23 -08:00
commit b85ae49aae
2 changed files with 36 additions and 4 deletions

View file

@ -301,4 +301,8 @@ https://github.com/gorbit99/codewindow.nvim
- Fix `vim.formatter.conform-nvim.setupOpts.formatters` type for correct merging
[SmackleFunky](https://github.com/SmackleFunky):
- Updated codecompanion-nvim adapters to allow specifying a model.
<!-- vim: set textwidth=80: -->

View file

@ -1,6 +1,6 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) int str enum nullOr attrs;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.types) int str enum nullOr attrs either submodule;
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
in {
options.vim.assistant = {
@ -202,9 +202,23 @@ in {
strategies = {
chat = {
adapter = mkOption {
type = nullOr str;
default = null;
description = "Adapter used for the chat strategy.";
type = nullOr (either str (submodule {
options = {
name = mkOption {
type = nullOr str;
default = null;
description = "Name of the Adapter";
};
model = mkOption {
type = nullOr str;
default = null;
description = "Model used for Adapter.";
};
};
}));
};
keymaps = mkOption {
@ -253,9 +267,23 @@ in {
inline = {
adapter = mkOption {
type = nullOr str;
default = null;
description = "Adapter used for the inline strategy.";
type = nullOr (either str (submodule {
options = {
name = mkOption {
type = nullOr str;
default = null;
description = "Name of the Adapter";
};
model = mkOption {
type = nullOr str;
default = null;
description = "Model used for Adapter.";
};
};
}));
};
variables = mkOption {