fix: remove unnecessary error handling in token counting functions

This commit is contained in:
CaIon
2025-06-21 01:16:54 +08:00
parent 2c0fd2915b
commit 3164e86278
5 changed files with 6 additions and 24 deletions
-3
View File
@@ -67,9 +67,6 @@ func AudioHelper(c *gin.Context) (openaiErr *dto.OpenAIErrorWithStatusCode) {
preConsumedTokens := common.PreConsumedQuota
if relayInfo.RelayMode == relayconstant.RelayModeAudioSpeech {
promptTokens = service.CountTTSToken(audioRequest.Input, audioRequest.Model)
if err != nil {
return service.OpenAIErrorWrapper(err, "count_audio_token_failed", http.StatusInternalServerError)
}
preConsumedTokens = promptTokens
relayInfo.PromptTokens = promptTokens
}