From 4db03cb6aa2151119926a211148ca60553ed543a Mon Sep 17 00:00:00 2001 From: Thien Tran Date: Thu, 27 Feb 2025 14:07:33 +0800 Subject: [PATCH] Remove stream_options check Signed-off-by: Thien Tran --- pkg/plugins/gateway/gateway.go | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/pkg/plugins/gateway/gateway.go b/pkg/plugins/gateway/gateway.go index 7230c8af..4ed34c55 100644 --- a/pkg/plugins/gateway/gateway.go +++ b/pkg/plugins/gateway/gateway.go @@ -338,24 +338,6 @@ func (s *Server) HandleRequestBody(ctx context.Context, requestID string, req *e } stream, ok = jsonMap["stream"].(bool) - if stream && ok { - streamOptions, ok := jsonMap["stream_options"].(map[string]interface{}) - if !ok { - klog.ErrorS(nil, "no stream option available", "requestID", requestID, "jsonMap", jsonMap) - return generateErrorResponse(envoyTypePb.StatusCode_InternalServerError, - []*configPb.HeaderValueOption{{Header: &configPb.HeaderValue{ - Key: HeaderErrorNoStreamOptions, RawValue: []byte("stream options not set")}}}, - "no stream option available"), model, targetPodIP, stream, term - } - includeUsage, ok := streamOptions["include_usage"].(bool) - if !includeUsage || !ok { - klog.ErrorS(nil, "no stream with usage option available", "requestID", requestID, "jsonMap", jsonMap) - return generateErrorResponse(envoyTypePb.StatusCode_InternalServerError, - []*configPb.HeaderValueOption{{Header: &configPb.HeaderValue{ - Key: HeaderErrorStreamOptionsIncludeUsage, RawValue: []byte("include usage for stream options not set")}}}, - "no stream with usage option available"), model, targetPodIP, stream, term - } - } headers := []*configPb.HeaderValueOption{} if routingStrategy == "" {