Update go version

This commit is contained in:
dwrz
2026-08-21 10:23:37 +00:00
parent 78248a6145
commit c2e2d9ea02
466 changed files with 67766 additions and 2881 deletions

View File

@@ -17,7 +17,7 @@ var (
)
type streamable interface {
ChatCompletionStreamResponse | CompletionResponse
ChatCompletionStreamResponse | CompletionResponse | ResponseStreamEvent
}
type streamReader[T streamable] struct {
@@ -64,7 +64,13 @@ func (stream *streamReader[T]) processLines() ([]byte, error) {
rawLine, readErr := stream.reader.ReadBytes('\n')
if readErr != nil || hasErrorPrefix {
respErr := stream.unmarshalError()
if respErr != nil {
// respErr.Error can be nil even when respErr itself isn't:
// any payload that round-trips through unmarshaler.Unmarshal
// (an empty object, an aborted partial frame after context
// cancellation, etc.) ends up as a non-nil *ErrorResponse with
// a nil Error field. Wrapping that produced the famously
// useless "error, <nil>" message in #1060.
if respErr != nil && respErr.Error != nil {
return nil, fmt.Errorf("error, %w", respErr.Error)
}
return nil, readErr