Multiple inline and chat adapters #34
Replies: 2 comments 1 reply
-
This definitely makes a lot of sense. One way I can see this working is: require("codecompanion").setup({
adapters = {
anthropic = require("codecompanion.adapters").use("anthropic", {
env = {
api_key = "cmd:gpg --decrypt ~/.dotfiles/.config/gpg/anthropic-api-key.gpg 2>/dev/null",
},
}),
openai = require("codecompanion.adapters").use("openai", {
env = {
api_key = "cmd:gpg --decrypt ~/.dotfiles/.config/gpg/openai-api-key.gpg 2>/dev/null",
},
}),
something_else = "something_else"
},
strategies = {
chat = "anthropic",
inline = "openai"
}
}) Then you could always run a command like Because it's not part of my workflow, it's not something I have the time to add in the coming weeks but would be happy to accept a PR with tests for this if we can agree on the API. |
Beta Was this translation helpful? Give feedback.
-
@lazymaniac - I've made some changes as per #39. You can do something like |
Beta Was this translation helpful? Give feedback.
-
Hey, first of all great plugin! I really like using it and it fits my workflow very well.
I have one request:
Option to define multiple adapters for chat and inline strategies would be great. At my work openai is phibited due to security regulations and I've to use 2 plugins one for ollama and one for gpt for coding my own projects with x more keymaps. I think this option would be great for other users too.
The adapters section in config may look like this:
So later in config it would be possible to specify
adater = "myOllamaInline"
as provider for action likeChat with Ollama
I'm thinking loud, and maybe there is better design, but anyway it would be great to have such option. If you need help I can try to write some base and create PR.
Beta Was this translation helpful? Give feedback.
All reactions