committed by
GitHub
parent
980504b47e
commit
62eb4beed2
@@ -6,6 +6,8 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
utils "github.com/sashabaranov/go-openai/internal"
|
||||
)
|
||||
|
||||
type streamable interface {
|
||||
@@ -19,7 +21,7 @@ type streamReader[T streamable] struct {
|
||||
reader *bufio.Reader
|
||||
response *http.Response
|
||||
errAccumulator errorAccumulator
|
||||
unmarshaler unmarshaler
|
||||
unmarshaler utils.Unmarshaler
|
||||
}
|
||||
|
||||
func (stream *streamReader[T]) Recv() (response T, err error) {
|
||||
@@ -63,7 +65,7 @@ waitForData:
|
||||
return
|
||||
}
|
||||
|
||||
err = stream.unmarshaler.unmarshal(line, &response)
|
||||
err = stream.unmarshaler.Unmarshal(line, &response)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user