Skip to content

Commit 69894ff

Browse files
committed
fix: adapt codecompanion newest api
1 parent 59e3d9e commit 69894ff

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

lua/modules/configs/tool/codecompanion.lua

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,22 @@ return function()
3535
},
3636
},
3737
adapters = {
38-
openrouter = function()
39-
return require("codecompanion.adapters").extend("openai_compatible", {
40-
env = {
41-
url = "https://openrouter.ai/api",
42-
api_key = secret_key,
43-
chat_url = "/v1/chat/completions",
44-
},
45-
schema = {
46-
model = {
47-
default = vim.g.current_chat_model,
38+
http = {
39+
openrouter = function()
40+
return require("codecompanion.adapters").extend("openai_compatible", {
41+
env = {
42+
url = "https://openrouter.ai/api",
43+
api_key = secret_key,
44+
chat_url = "/v1/chat/completions",
4845
},
49-
},
50-
})
51-
end,
46+
schema = {
47+
model = {
48+
default = vim.g.current_chat_model,
49+
},
50+
},
51+
})
52+
end,
53+
},
5254
},
5355
display = {
5456
diff = {

0 commit comments

Comments
 (0)