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 -- disable lua_ls formatting capability if you want to use StyLua to format your lua code
-- "lua_ls", -- "lua_ls",
"volar", "volar",
"vtsls",
"ts_ls",
}, },
timeout_ms = 7000, -- default format timeout timeout_ms = 7000, -- default format timeout
-- filter = function(client) -- fully override the default formatting function -- filter = function(client) -- fully override the default formatting function
+61 -26
View File
@@ -17,38 +17,73 @@ return {
-- Plugin configuration options -- Plugin configuration options
-- Remove the type annotation if avante.Config is undefined -- Remove the type annotation if avante.Config is undefined
opts = { opts = {
-- Primary AI provider for code generation provider = "deepseek_safe",
provider = "deepseek",
-- Provider for automatic code suggestions (autocompletion) behaviour = {
auto_suggestions_provider = "deepseek", auto_approve_tool_permissions = true,
-- Plugin operation mode (commented out, uses default value) },
-- mode = "legacy",
-- Plugin behavior settings (commented out) vendors = {
-- behaviour = { deepseek_safe = {
-- 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
__inherited_from = "openai", __inherited_from = "openai",
-- Environment variable name containing the API key
api_key_name = "DEEPSEEK_API_KEY", api_key_name = "DEEPSEEK_API_KEY",
-- API endpoint for DeepSeek requests
endpoint = "https://api.deepseek.com", endpoint = "https://api.deepseek.com",
-- AI model to use (specialized for programming) model = "deepseek-chat",
model = "deepseek-coder", timeout = 120000,
timeout = 30000, -- Timeout in milliseconds max_tokens = 8192,
extra_request_body = { extra_request_body = {
temperature = 0.2, temperature = 0,
max_tokens = 8192, max_tokens = 8192,
}, },
-- Maximum number of tokens in model response
-- max_tokens = 8192, -- parse_curl_args = function(opts, code_opts)
-- Tools disable flag (commented out) -- local log_file = io.open("/tmp/avante_debug.log", "a")
-- disable_tools = true, --
-- -- 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,
}, },
}, },
}, },