新增
This commit is contained in:
parent
6b40b46651
commit
88e2e3caad
@ -219,7 +219,9 @@ func postConsumeQuota(ctx context.Context, tokenId int, quotaDelta int, totalQuo
|
|||||||
}
|
}
|
||||||
// totalQuota is total quota consumed
|
// totalQuota is total quota consumed
|
||||||
if totalQuota != 0 {
|
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.RecordConsumeLog(ctx, userId, channelId, totalQuota, 0, modelName, tokenName, totalQuota, logContent)
|
||||||
model.UpdateUserUsedQuotaAndRequestCount(userId, totalQuota)
|
model.UpdateUserUsedQuotaAndRequestCount(userId, totalQuota)
|
||||||
model.UpdateChannelUsedQuota(channelId, totalQuota)
|
model.UpdateChannelUsedQuota(channelId, totalQuota)
|
||||||
|
Loading…
Reference in New Issue
Block a user