fix: chat stream resp error (#259)
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -43,6 +44,9 @@ func (c *Client) CreateCompletionStream(
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest {
|
||||
return nil, c.handleErrorResp(resp)
|
||||
}
|
||||
|
||||
stream = &CompletionStream{
|
||||
streamReader: &streamReader[CompletionResponse]{
|
||||
|
||||
Reference in New Issue
Block a user