feat: updated deepseek configs

This commit is contained in:
2026-05-11 07:29:09 +00:00
parent 0f73cbcb92
commit 5dab9b2499
2 changed files with 63 additions and 26 deletions
+2
View File
@@ -30,6 +30,8 @@ return {
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
-- "lua_ls",
"volar",
"vtsls",
"ts_ls",
},
timeout_ms = 7000, -- default format timeout
-- filter = function(client) -- fully override the default formatting function
+61 -26
View File
@@ -17,38 +17,73 @@ return {
-- Plugin configuration options
-- Remove the type annotation if avante.Config is undefined
opts = {
-- Primary AI provider for code generation
provider = "deepseek",
-- Provider for automatic code suggestions (autocompletion)
auto_suggestions_provider = "deepseek",
-- Plugin operation mode (commented out, uses default value)
-- mode = "legacy",
-- Plugin behavior settings (commented out)
-- behaviour = {
-- auto_apply_diff_after_generation = false,
-- auto_focus_on_diff_view = true,
-- },
-- AI providers configuration
providers = {
-- Specific configuration for DeepSeek provider
deepseek = {
-- Inheritance of base configuration from OpenAI provider
provider = "deepseek_safe",
behaviour = {
auto_approve_tool_permissions = true,
},
vendors = {
deepseek_safe = {
__inherited_from = "openai",
-- Environment variable name containing the API key
api_key_name = "DEEPSEEK_API_KEY",
-- API endpoint for DeepSeek requests
endpoint = "https://api.deepseek.com",
-- AI model to use (specialized for programming)
model = "deepseek-coder",
timeout = 30000, -- Timeout in milliseconds
model = "deepseek-chat",
timeout = 120000,
max_tokens = 8192,
extra_request_body = {
temperature = 0.2,
temperature = 0,
max_tokens = 8192,
},
-- Maximum number of tokens in model response
-- max_tokens = 8192,
-- Tools disable flag (commented out)
-- disable_tools = true,
-- parse_curl_args = function(opts, code_opts)
-- local log_file = io.open("/tmp/avante_debug.log", "a")
--
-- -- Helper function to extract text from content
-- local function get_content_text(content)
-- if type(content) == "string" then
-- return content
-- elseif type(content) == "table" then
-- -- Content can be array of {type="text", text="..."}
-- if content.text then
-- return content.text
-- elseif content[1] and content[1].text then
-- return content[1].text
-- end
-- return vim.inspect(content) -- fallback
-- end
-- return ""
-- end
--
-- if log_file and code_opts.messages then
-- log_file:write "\n=== NEW REQUEST ===\n"
-- log_file:write(string.format("Total messages: %d\n", #code_opts.messages))
--
-- -- Check for duplicates
-- if #code_opts.messages >= 2 then
-- local last = code_opts.messages[#code_opts.messages]
-- local prev = code_opts.messages[#code_opts.messages - 1]
--
-- local last_text = get_content_text(last.content)
-- local prev_text = get_content_text(prev.content)
--
-- log_file:write(string.format("\nLast text: %s\n", last_text))
-- log_file:write(string.format("Prev text: %s\n", prev_text))
--
-- if last_text == prev_text and last_text ~= "" then
-- log_file:write "\n!!! DUPLICATE DETECTED !!!\n"
-- log_file:close()
-- vim.notify("Duplicate message detected! Aborting.", vim.log.levels.ERROR)
-- return nil
-- end
-- end
--
-- log_file:close()
-- end
--
-- local openai = require("avante.providers").openai
-- return openai.parse_curl_args(opts, code_opts)
-- end,
},
},
},