From c6125eccb1aacb356bda8222205d37354da0635d Mon Sep 17 00:00:00 2001 From: HynoR <20227709+HynoR@users.noreply.github.com> Date: Sat, 15 Nov 2025 13:24:00 +0800 Subject: [PATCH] fix: Set default to unsupported value for gpt-5 model series requests --- relay/channel/openai/adaptor.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/relay/channel/openai/adaptor.go b/relay/channel/openai/adaptor.go index 55bd1402c..035288978 100644 --- a/relay/channel/openai/adaptor.go +++ b/relay/channel/openai/adaptor.go @@ -306,10 +306,11 @@ func (a *Adaptor) ConvertOpenAIRequest(c *gin.Context, info *relaycommon.RelayIn request.Temperature = nil } + // gpt-5系列模型适配 归零不再支持的参数 if strings.HasPrefix(info.UpstreamModelName, "gpt-5") { - if info.UpstreamModelName != "gpt-5-chat-latest" { - request.Temperature = nil - } + request.Temperature = nil + request.TopP = 0 // oai 的 top_p 默认值是 1.0,但是为了 omitempty 属性直接不传,这里显式设置为 0 + request.LogProbs = false } // 转换模型推理力度后缀