🐛 fix: Handle empty openaiResponse.Choices in HandlerChatStream
This commit is contained in:
parent
58a0b6f9bc
commit
c6a0c87ad1
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user