add baidu

This commit is contained in:
zhangkun9038@dingtalk.com 2025-02-12 23:47:03 +08:00
parent ab9127fcbc
commit 71ac22a864
2 changed files with 4 additions and 0 deletions

View File

@ -149,6 +149,7 @@ M._defaults = {
timeout = 30000, -- Timeout in milliseconds timeout = 30000, -- Timeout in milliseconds
temperature = 0, temperature = 0,
max_tokens = 8000, max_tokens = 8000,
appid = "app-QzGDePL0",
}, },
---@type AvanteSupportedProvider ---@type AvanteSupportedProvider
["claude-opus"] = { ["claude-opus"] = {

View File

@ -283,6 +283,9 @@ M.parse_curl_args = function(provider, prompt_opts)
["Content-Type"] = "application/json", ["Content-Type"] = "application/json",
} }
-- Add appid header for baidu provider
if Config.provider == "baidu" then headers["appid"] = "app-QzGDePL0" end
if P.env.require_api_key(base) then if P.env.require_api_key(base) then
local api_key = provider.parse_api_key() local api_key = provider.parse_api_key()
if api_key == nil then if api_key == nil then