From 4687c67685783ac03817090cf93e7a945cfc9018 Mon Sep 17 00:00:00 2001 From: Ade9 Date: Fri, 25 Apr 2025 08:43:03 +0300 Subject: [PATCH] nullability fix --- llmproxymetrics.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/llmproxymetrics.go b/llmproxymetrics.go index 3150bd1..52b1643 100644 --- a/llmproxymetrics.go +++ b/llmproxymetrics.go @@ -42,10 +42,12 @@ func createProxy(target *url.URL) func(http.ResponseWriter, *http.Request) { var jsonData map[string]interface{} json.NewDecoder(r.Body).Decode(&jsonData) - if jsonData["stream"].(bool) == false { - notStreamed.Inc() - } else { - streamed.Inc() + if jsonData["stream"] != nil { + if !jsonData["stream"].(bool) { + notStreamed.Inc() + } else { + streamed.Inc() + } } modifyResponse := func(response *http.Response) error {