Skip to content

Commit db75780

Browse files
committed
feat: explicitely logs unknown embeddings types
1 parent fae9b4d commit db75780

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/plugins/gateway/util.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package gateway
1818

1919
import (
2020
"encoding/json"
21+
"fmt"
2122
"strings"
2223

2324
configPb "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
@@ -182,6 +183,11 @@ func checkEmbeddingInputSequenceLen(requestID string, embeddingObj openai.Embedd
182183
size = len(*input)
183184
isArrayType = true
184185
default:
186+
// Should never happend, but if input is of an unexpected non-nil type, let's explicitly error log it.
187+
// Size will be 0 in this case, which is then handled by the check below.
188+
if input != nil {
189+
klog.ErrorS(nil, "unhandled embedding input type", "requestID", requestID, "inputType", fmt.Sprintf("%T", input))
190+
}
185191
}
186192

187193
if size == 0 {

0 commit comments

Comments
 (0)