refactor(gateway): avoid extra OpenAI WS body map copy
This commit is contained in:
parent
5a3e193b53
commit
09af6ebd40
@ -2793,13 +2793,8 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco
|
||||
|
||||
// 命中 WS 时仅走 WebSocket Mode;不再自动回退 HTTP。
|
||||
if wsDecision.Transport == OpenAIUpstreamTransportResponsesWebsocketV2 {
|
||||
// WS 分支不会再回落 HTTP;重连恢复可直接更新 reqBody,避免额外保留一份完整顶层 map。
|
||||
wsReqBody := reqBody
|
||||
if len(reqBody) > 0 {
|
||||
wsReqBody = make(map[string]any, len(reqBody))
|
||||
for k, v := range reqBody {
|
||||
wsReqBody[k] = v
|
||||
}
|
||||
}
|
||||
_, hasPreviousResponseID := wsReqBody["previous_response_id"]
|
||||
logOpenAIWSModeDebug(
|
||||
"forward_start account_id=%d account_type=%s model=%s stream=%v has_previous_response_id=%v",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user