日志修改详情显示
This commit is contained in:
parent
9bc11bde28
commit
49ea44c65b
@ -435,11 +435,14 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
|
|||||||
common.LogError(ctx, "error update user quota cache: "+err.Error())
|
common.LogError(ctx, "error update user quota cache: "+err.Error())
|
||||||
}
|
}
|
||||||
if quota != 0 {
|
if quota != 0 {
|
||||||
logContent := fmt.Sprintf("模型倍率 %.2f", modelRatio)
|
// 对modelRatio进行计算
|
||||||
|
modelRatio = modelRatio * 0.002
|
||||||
|
logContent := fmt.Sprintf("单价 $%.4f/1k tokens,补全与官方一致", modelRatio)
|
||||||
model.RecordConsumeLog(ctx, userId, channelId, promptTokens, completionTokens, textRequest.Model, tokenName, quota, logContent)
|
model.RecordConsumeLog(ctx, userId, channelId, promptTokens, completionTokens, textRequest.Model, tokenName, quota, logContent)
|
||||||
model.UpdateUserUsedQuotaAndRequestCount(userId, quota)
|
model.UpdateUserUsedQuotaAndRequestCount(userId, quota)
|
||||||
model.UpdateChannelUsedQuota(channelId, quota)
|
model.UpdateChannelUsedQuota(channelId, quota)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}(c.Request.Context())
|
}(c.Request.Context())
|
||||||
|
Loading…
Reference in New Issue
Block a user