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