refactor: providers config (#2117)

This commit is contained in:
yetone
2025-06-03 04:01:01 +08:00
committed by GitHub
parent b89e6d84a0
commit e9ab2ca2fd
12 changed files with 327 additions and 251 deletions

View File

@@ -64,13 +64,17 @@
-- 在此处添加任何选项
-- 例如
provider = "openai",
openai = {
endpoint = "https://api.openai.com/v1",
model = "gpt-4o", -- 您想要的模型(或使用 gpt-4o 等)
timeout = 30000, -- 超时时间(毫秒),增加此值以适应推理模型
temperature = 0,
max_tokens = 8192, -- 增加此值以包括推理模型的推理令牌
--reasoning_effort = "medium", -- low|medium|high仅用于推理模型
providers = {
openai = {
endpoint = "https://api.openai.com/v1",
model = "gpt-4o", -- 您想要的模型(或使用 gpt-4o 等)
extra_request_body = {
timeout = 30000, -- 超时时间(毫秒),增加此值以适应推理模型
temperature = 0,
max_tokens = 8192, -- 增加此值以包括推理模型的推理令牌
--reasoning_effort = "medium", -- low|medium|high仅用于推理模型
},
},
},
},
-- 如果您想从源代码构建,请执行 `make BUILD_FROM_SOURCE=true`
@@ -309,12 +313,15 @@ _请参见 [config.lua#L9](./lua/avante/config.lua) 以获取完整配置_
-- 目前将其指定为 `copilot` 提供者是危险的因为https://github.com/yetone/avante.nvim/issues/1048
-- 当然,您可以通过增加 `suggestion.debounce` 来减少请求频率。
auto_suggestions_provider = "claude",
cursor_applying_provider = nil, -- Cursor 规划模式应用阶段使用的提供者,默认为 nil当为 nil 时使用 Config.provider 作为应用阶段的提供者
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-3-5-sonnet-20241022",
temperature = 0,
max_tokens = 4096,
providers = {
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-3-5-sonnet-20241022",
extra_request_body = {
temperature = 0,
max_tokens = 4096,
},
},
},
---指定特殊的 dual_boost 模式
---1. enabled: 是否启用 dual_boost 模式。默认为 false。