From 88e2e3caad3241f7e15f2d845d4c0b0d6600cc1a Mon Sep 17 00:00:00 2001 From: wood Date: Tue, 5 Dec 2023 01:42:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/relay-utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controller/relay-utils.go b/controller/relay-utils.go index 070f459b..3031b084 100644 --- a/controller/relay-utils.go +++ b/controller/relay-utils.go @@ -219,7 +219,9 @@ func postConsumeQuota(ctx context.Context, tokenId int, quotaDelta int, totalQuo } // totalQuota is total quota consumed if totalQuota != 0 { - logContent := fmt.Sprintf("模型倍率 %.2f,分组倍率 %.2f", modelRatio, groupRatio) + outputPrice := modelRatio * 0.002 + var logContent string + logContent = fmt.Sprintf("单价: $%.6g/1k tokens", outputPrice) model.RecordConsumeLog(ctx, userId, channelId, totalQuota, 0, modelName, tokenName, totalQuota, logContent) model.UpdateUserUsedQuotaAndRequestCount(userId, totalQuota) model.UpdateChannelUsedQuota(channelId, totalQuota)