Sharing config

This commit is contained in:
Chris
2025-11-10 09:19:30 +00:00
parent a21a1a3386
commit 2255489fd8
4 changed files with 48 additions and 27 deletions

View File

@@ -4,12 +4,25 @@ return {
require('codecompanion').setup {
adapters = {
http = {
openrouter = function()
default = function()
if (require('helpers').has_copilot()) then
return require('codecompanion.adapters').extend('copilot', {
schema = {
model = {
default = vim.env.DEFAULT_AI_MODEL,
},
max_tokens = {
default = 1000000,
},
}
})
end
return require('codecompanion.adapters').extend('openai_compatible', {
env = {
url = vim.env.DEFAULT_OPENAI_API_BASE,
api_key = vim.env.DEFAULT_OPENAI_API_KEY,
chat_url = '/v1/chat/completions',
chat_url = '/chat/completions',
models_endpoint = '/models',
},
schema = {
model = {
@@ -31,7 +44,7 @@ return {
},
strategies = {
chat = {
adapter = 'openrouter',
adapter = 'default',
slash_commands = {
-- codebase = require('vectorcode.integrations').codecompanion.chat.make_slash_command(),
},
@@ -63,13 +76,13 @@ return {
},
inline = {
adapter = {
name = 'openrouter',
name = 'default',
model = vim.env.FAST_MODEL,
},
},
cmd = {
adapter = {
name = 'openrouter',
name = 'default',
model = vim.env.FAST_MODEL,
},
},