feat(audio): enhance audio request handling with token type detection and streaming support

This commit is contained in:
CaIon
2025-12-13 17:24:23 +08:00
parent 29565c837f
commit be2a863b9b
6 changed files with 159 additions and 70 deletions
+1 -1
View File
@@ -181,7 +181,7 @@ func TextHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *types
return newApiErr
}
if strings.HasPrefix(info.OriginModelName, "gpt-4o-audio") {
if usage.(*dto.Usage).CompletionTokenDetails.AudioTokens > 0 || usage.(*dto.Usage).PromptTokensDetails.AudioTokens > 0 {
service.PostAudioConsumeQuota(c, info, usage.(*dto.Usage), "")
} else {
postConsumeQuota(c, info, usage.(*dto.Usage), "")