Skip to content

Commit 24299c1

Browse files
authored
Merge pull request #96 from doringeman/openai-recorder
Implement Flusher interface for responseRecorder
2 parents fcf45f4 + ac05573 commit 24299c1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/metrics/openai_recorder.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ func (rr *responseRecorder) WriteHeader(statusCode int) {
2929
rr.ResponseWriter.WriteHeader(statusCode)
3030
}
3131

32+
func (rr *responseRecorder) Flush() {
33+
if flusher, ok := rr.ResponseWriter.(http.Flusher); ok {
34+
flusher.Flush()
35+
}
36+
}
37+
3238
type RequestResponsePair struct {
3339
ID string `json:"id"`
3440
Model string `json:"model"`

0 commit comments

Comments
 (0)