From 92a21f64ebede108ced0e1d9425db44785ba9d84 Mon Sep 17 00:00:00 2001 From: "Laisky.Cai" Date: Sun, 26 Jan 2025 12:22:50 +0000 Subject: [PATCH] fix: correct audio token accumulation in CountTokenMessages function --- relay/adaptor/openai/token.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay/adaptor/openai/token.go b/relay/adaptor/openai/token.go index b944274d..c10d61ac 100644 --- a/relay/adaptor/openai/token.go +++ b/relay/adaptor/openai/token.go @@ -125,7 +125,7 @@ func CountTokenMessages(ctx context.Context, if err != nil { logger.SysError("error counting audio tokens: " + err.Error()) } else { - audioTokens += audioTokens + totalAudioTokens += audioTokens } } }