avante update

This commit is contained in:
Barak Michener 2024-12-17 16:31:06 -08:00
parent 87ed7f3527
commit 1395146661

View file

@ -1,37 +1,19 @@
require("avante_lib").load() require("avante_lib").load()
require("avante").setup({ require("avante").setup({
provider = "ollama", provider = "ollama",
auto_suggestions_provider = "ollama", auto_suggestions_provider = "ollama",
behavior = { behavior = {
auto_suggestions = false, auto_suggestions = false,
}, },
hints = { hints = {
enabled = false, enabled = false,
}, },
vendors = { vendors = {
---@type AvanteProvider ollama = {
ollama = { endpoint = "http://127.0.0.1:11434/v1",
["local"] = true, model = "qwen2.5-coder:7b",
endpoint = "127.0.0.1:11434/v1", __inherited_from = "openai",
model = "qwen2.5-coder:7b", api_key_name = "",
parse_curl_args = function(opts, code_opts) },
return { },
url = opts.endpoint .. "/chat/completions",
headers = {
["Accept"] = "application/json",
["Content-Type"] = "application/json",
},
body = {
model = opts.model,
messages = require("avante.providers").copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced
max_tokens = 2048,
stream = true,
},
}
end,
parse_response_data = function(data_stream, event_state, opts)
require("avante.providers").openai.parse_response(data_stream, event_state, opts)
end,
},
},
}) })