feat(nvim): add cheap openai provider for avante

nixos
Moritz Böhme 2024-10-26 17:06:15 +02:00
parent 49afd873da
commit 13642a683f
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 18 additions and 4 deletions

View File

@ -19,14 +19,28 @@ in
require("avante_lib").load() require("avante_lib").load()
require("avante").setup({ require("avante").setup({
provider = "openai", provider = "openai",
auto_suggestions_provider = "openai", auto_suggestions_provider = "openai-cheap",
behaviour = { behaviour = {
-- auto_suggestions = true, auto_suggestions = false,
}, },
openai = { openai = {
model = "gpt-4o", model = "gpt-4o",
api_key_name = "cmd:cat /run/agenix/openai" api_key_name = "cmd:cat /run/agenix/openai",
} },
vendors = {
---@type AvanteProvider
["openai-cheap"] = {
model = "gpt-4o-mini",
api_key_name = "cmd:cat /run/agenix/openai",
endpoint = "https://api.openai.com/v1",
parse_curl_args = function(opts, code_opts)
return require("avante.providers").openai.parse_curl_args(opts, code_opts)
end,
parse_response_data = function(data_stream, event_state, opts)
return require("avante.providers").openai.parse_response(data_stream, event_state, opts)
end
},
},
}) })
''; '';
plugins.dressing.enable = true; plugins.dressing.enable = true;