can set ai with env vars
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
local provider = vim.env.AI_PROVIDER
|
||||
return {
|
||||
{
|
||||
'olimorris/codecompanion.nvim',
|
||||
@ -42,22 +43,17 @@ return {
|
||||
},
|
||||
},
|
||||
env = {
|
||||
api_key = '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',
|
||||
api_key = vim.env.ANTHROPIC_API_KEY,
|
||||
},
|
||||
})
|
||||
end,
|
||||
allow_insecure = true,
|
||||
},
|
||||
--Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
|
||||
-- strategies = {
|
||||
-- chat = { adapter = 'anthropic' },
|
||||
-- inline = { adapter = 'anthropic' },
|
||||
-- cmd = { adapter = 'anthropic' },
|
||||
-- },
|
||||
strategies = {
|
||||
chat = { adapter = 'ollama' },
|
||||
inline = { adapter = 'ollama' },
|
||||
cmd = { adapter = 'ollama' },
|
||||
chat = { adapter = provider or 'anthropic' },
|
||||
inline = { adapter = provider or 'anthropic' },
|
||||
cmd = { adapter = provider or 'anthropic' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user