diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/provider.go b/plugins/wasm-go/extensions/ai-proxy/provider/provider.go index 9799974bae..8081f6a6d0 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/provider.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/provider.go @@ -134,7 +134,7 @@ type TransformRequestBodyHandler interface { } // TransformRequestBodyHeadersHandler allows to transform request headers based on the request body. -// Some providers (e.g. baidu, gemini) transform request headers (e.g., path) based on the request body (e.g., model). +// Some providers (e.g. gemini) transform request headers (e.g., path) based on the request body (e.g., model). type TransformRequestBodyHeadersHandler interface { TransformRequestBodyHeaders(ctx wrapper.HttpContext, apiName ApiName, body []byte, headers http.Header, log wrapper.Log) ([]byte, error) } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go b/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go index 771feeb51e..1f78b76cd5 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go @@ -158,11 +158,11 @@ func (m *qwenProvider) onChatCompletionRequestBody(ctx wrapper.HttpContext, body streaming := request.Stream if streaming { - _ = proxywasm.ReplaceHttpRequestHeader("Accept", "text/event-stream") - _ = proxywasm.ReplaceHttpRequestHeader("X-DashScope-SSE", "enable") + headers.Set("Accept", "text/event-stream") + headers.Set("X-DashScope-SSE", "enable") } else { - _ = proxywasm.ReplaceHttpRequestHeader("Accept", "*/*") - _ = proxywasm.RemoveHttpRequestHeader("X-DashScope-SSE") + headers.Set("Accept", "*/*") + headers.Del("X-DashScope-SSE") } return m.buildQwenTextGenerationRequest(ctx, request, streaming)