From baa51ed8003ca400c0a5e8da15952a22d1c53ae9 Mon Sep 17 00:00:00 2001 From: quzard <1191890118@qq.com> Date: Fri, 23 Jun 2023 17:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=8D=E8=B4=B9=20=E4=B8=8D=E6=B6=88?= =?UTF-8?q?=E8=80=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/relay-text.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/relay-text.go b/controller/relay-text.go index 66a09c10..ba30c6c1 100644 --- a/controller/relay-text.go +++ b/controller/relay-text.go @@ -84,7 +84,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode { // because the user has enough quota preConsumedQuota = 0 } - if consumeQuota && preConsumedQuota > 0 && strings.Contains(channelName, "反代") == false { + if consumeQuota && preConsumedQuota > 0 && strings.Contains(channelName, "免费") == false { err := model.PreConsumeTokenQuota(tokenId, preConsumedQuota) if err != nil { return errorWrapper(err, "pre_consume_token_quota_failed", http.StatusOK) @@ -148,7 +148,7 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode { } tokenName := c.GetString("token_name") model.RecordLog(userId, model.LogTypeConsume, fmt.Sprintf("通过渠道「%s」通过令牌「%s」使用模型 %s 消耗 %s(模型倍率 %.2f,分组倍率 %.2f)%d prompt + %d completion = %d tokens", channelName, tokenName, textRequest.Model, common.LogQuota(quota), modelRatio, groupRatio, prompt, completion, tokens)) - if strings.Contains(channelName, "反代") == false { + if strings.Contains(channelName, "免费") == false { quotaDelta := quota - preConsumedQuota err := model.PostConsumeTokenQuota(tokenId, quotaDelta) if err != nil {