Commit 96e3eece by CalciumIon

fix: xAI missing finish_reason #572

parent 31df7015
...@@ -98,6 +98,11 @@ func OaiStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.Rel ...@@ -98,6 +98,11 @@ func OaiStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.Rel
shouldSendLastResp = false shouldSendLastResp = false
} }
} }
for _, choice := range lastStreamResponse.Choices {
if choice.FinishReason != nil {
shouldSendLastResp = true
}
}
} }
if shouldSendLastResp { if shouldSendLastResp {
service.StringData(c, lastStreamData) service.StringData(c, lastStreamData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment