fix: xAI missing finish_reason #572

This commit is contained in:
CalciumIon
2024-11-30 16:57:31 +08:00
parent 9c4d30602c
commit 1774be8536

View File

@@ -98,6 +98,11 @@ func OaiStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.Rel
shouldSendLastResp = false
}
}
for _, choice := range lastStreamResponse.Choices {
if choice.FinishReason != nil {
shouldSendLastResp = true
}
}
}
if shouldSendLastResp {
service.StringData(c, lastStreamData)