update ai plugin to use anthropic
This commit is contained in:
@ -21,6 +21,10 @@ return {
|
||||
cmd = { 'CodeCompanion', 'CodeCompanionAction', 'CodeCompanionChat', 'CodeCompanionCmd' },
|
||||
opts = {
|
||||
adapters = {
|
||||
opts = {
|
||||
show_defaults = false,
|
||||
show_model_choices = true,
|
||||
},
|
||||
ollama = function()
|
||||
return require('codecompanion.adapters').extend('ollama', {
|
||||
schema = {
|
||||
@ -32,6 +36,11 @@ return {
|
||||
end,
|
||||
anthropic = function()
|
||||
return require('codecompanion.adapters').extend('anthropic', {
|
||||
schema = {
|
||||
model = {
|
||||
default = 'claude-sonnet-4-20250514',
|
||||
},
|
||||
},
|
||||
env = {
|
||||
api_key = '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',
|
||||
},
|
||||
@ -41,9 +50,9 @@ return {
|
||||
},
|
||||
--Refer to: https://github.com/olimorris/codecompanion.nvim/blob/main/lua/codecompanion/config.lua
|
||||
strategies = {
|
||||
chat = { adapter = 'ollama' },
|
||||
inline = { adapter = 'ollama' },
|
||||
cmd = { adapter = 'ollama' },
|
||||
chat = { adapter = 'anthropic' },
|
||||
inline = { adapter = 'anthropic' },
|
||||
cmd = { adapter = 'anthropic' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user