feat: realtime pre consume

(cherry picked from commit 273d154e1640bae26b7caedddf1685e9ff21ab74)
This commit is contained in:
1808837298@qq.com
2024-10-07 19:15:14 +08:00
committed by CalciumIon
parent 24b3ed50d7
commit e5c05d77b7
2 changed files with 11 additions and 4 deletions

View File

@@ -576,8 +576,5 @@ func preConsumeUsage(ctx *gin.Context, info *relaycommon.RelayInfo, usage *dto.R
totalUsage.OutputTokenDetails.AudioTokens += usage.OutputTokenDetails.AudioTokens
// clear usage
err := service.PreWssConsumeQuota(ctx, info, usage)
if err == nil {
common.LogInfo(ctx, "realtime streaming consume usage success")
}
return err
}