diff --git a/pkg/metrics/openai_recorder.go b/pkg/metrics/openai_recorder.go index a5e691229..e1d5fc493 100644 --- a/pkg/metrics/openai_recorder.go +++ b/pkg/metrics/openai_recorder.go @@ -29,6 +29,12 @@ func (rr *responseRecorder) WriteHeader(statusCode int) { rr.ResponseWriter.WriteHeader(statusCode) } +func (rr *responseRecorder) Flush() { + if flusher, ok := rr.ResponseWriter.(http.Flusher); ok { + flusher.Flush() + } +} + type RequestResponsePair struct { ID string `json:"id"` Model string `json:"model"`