fix: chat stream resp error (#259)
This commit is contained in:
@@ -3,6 +3,7 @@ package openai
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type ChatCompletionStreamChoiceDelta struct {
|
||||
@@ -53,6 +54,9 @@ func (c *Client) CreateChatCompletionStream(
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusBadRequest {
|
||||
return nil, c.handleErrorResp(resp)
|
||||
}
|
||||
|
||||
stream = &ChatCompletionStream{
|
||||
streamReader: &streamReader[ChatCompletionStreamResponse]{
|
||||
|
||||
Reference in New Issue
Block a user