Return the usage info
Usage is missing.
This commit is contained in:
parent
f9774698e9
commit
18031ae270
@ -55,8 +55,8 @@ func StreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*model.E
|
|||||||
render.StringData(c, data) // if error happened, pass the data to client
|
render.StringData(c, data) // if error happened, pass the data to client
|
||||||
continue // just ignore the error
|
continue // just ignore the error
|
||||||
}
|
}
|
||||||
if len(streamResponse.Choices) == 0 {
|
if len(streamResponse.Choices) == 0 && streamResponse.Usage == nil {
|
||||||
// but for empty choice, we should not pass it to client, this is for azure
|
// but for empty choice and no usage, we should not pass it to client, this is for azure
|
||||||
continue // just ignore empty choice
|
continue // just ignore empty choice
|
||||||
}
|
}
|
||||||
render.StringData(c, data)
|
render.StringData(c, data)
|
||||||
|
Loading…
Reference in New Issue
Block a user