mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-16 08:04:10 +00:00
feat: support configuring ratio when estimating token number in stream mode
This commit is contained in:
@@ -110,7 +110,7 @@ func relayHelper(c *gin.Context) error {
|
||||
if consumeQuota {
|
||||
quota := 0
|
||||
if isStream {
|
||||
quota = int(float64(len(streamResponseText)) * 0.8)
|
||||
quota = int(float64(len(streamResponseText)) * common.BytesNumber2Quota)
|
||||
} else {
|
||||
quota = textResponse.Usage.TotalTokens
|
||||
}
|
||||
|
Reference in New Issue
Block a user