diff --git a/providers/openai/chat.go b/providers/openai/chat.go index bd1bea6b..574a5f1f 100644 --- a/providers/openai/chat.go +++ b/providers/openai/chat.go @@ -109,6 +109,11 @@ func (h *OpenAIStreamHandler) HandlerChatStream(rawLine *[]byte, dataChan chan s return } + if len(openaiResponse.Choices) == 0 { + *rawLine = nil + return + } + dataChan <- string(*rawLine) if h.isAzure {