mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-12-25 09:15:56 +08:00
feat: show stream & elapsed time in log detail
This commit is contained in:
@@ -211,7 +211,16 @@ func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
|
||||
if quota != 0 {
|
||||
tokenName := c.GetString(ctxkey.TokenName)
|
||||
logContent := fmt.Sprintf("%.2f × %.2f", modelRatio, groupRatio)
|
||||
model.RecordConsumeLog(ctx, meta.UserId, meta.ChannelId, 0, 0, imageRequest.Model, tokenName, quota, logContent)
|
||||
model.RecordConsumeLog(ctx, &model.Log{
|
||||
UserId: meta.UserId,
|
||||
ChannelId: meta.ChannelId,
|
||||
PromptTokens: 0,
|
||||
CompletionTokens: 0,
|
||||
ModelName: imageRequest.Model,
|
||||
TokenName: tokenName,
|
||||
Quota: int(quota),
|
||||
Content: logContent,
|
||||
})
|
||||
model.UpdateUserUsedQuotaAndRequestCount(meta.UserId, quota)
|
||||
channelId := c.GetInt(ctxkey.ChannelId)
|
||||
model.UpdateChannelUsedQuota(channelId, quota)
|
||||
|
||||
Reference in New Issue
Block a user