feat(ai-proxy): 新增 providerBasePath 配置并优化 providerDomain 处理方式 (#3686)

This commit is contained in:
rinfx
2026-04-08 15:23:15 +08:00
committed by GitHub
parent 1c9e981bf2
commit 228eb27e6a
7 changed files with 428 additions and 42 deletions

View File

@@ -300,7 +300,8 @@ func onHttpRequestBody(ctx wrapper.HttpContext, pluginConfig config.PluginConfig
log.Errorf("failed to replace request body by custom settings: %v", settingErr)
}
// 仅 /v1/chat/completions 和 /v1/completions 接口支持 stream_options 参数
if providerConfig.IsOpenAIProtocol() && (apiName == provider.ApiNameChatCompletion || apiName == provider.ApiNameCompletion) {
// generic provider 不做能力映射,不添加 stream_options
if providerConfig.IsOpenAIProtocol() && !providerConfig.IsGeneric() && (apiName == provider.ApiNameChatCompletion || apiName == provider.ApiNameCompletion) {
newBody = normalizeOpenAiRequestBody(newBody)
}
log.Debugf("[onHttpRequestBody] newBody=%s", newBody)