feat: add logging for model details and enhance action assignment in relay tasks

This commit is contained in:
CaIon
2025-10-11 11:56:44 +08:00
parent 5fbf860020
commit 07b099006c
3 changed files with 14 additions and 6 deletions

View File

@@ -173,7 +173,6 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
if hasInputReference {
action = constant.TaskActionGenerate
}
info.Action = action
if strings.HasPrefix(model, "sora-2") {
if size == "" {
@@ -199,6 +198,8 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
}
}
info.Action = action
return nil
}

View File

@@ -78,6 +78,7 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
}
}
}
println(fmt.Sprintf("model: %s, model_price: %.4f, group: %s, group_ratio: %.4f, final_ratio: %.4f", modelName, modelPrice, info.UsingGroup, groupRatio, ratio))
userQuota, err := model.GetUserQuota(info.UserId, false)
if err != nil {
taskErr = service.TaskErrorWrapper(err, "get_user_quota_failed", http.StatusInternalServerError)
@@ -146,11 +147,11 @@ func RelayTaskSubmit(c *gin.Context, info *relaycommon.RelayInfo) (taskErr *dto.
}
if quota != 0 {
tokenName := c.GetString("token_name")
gRatio := groupRatio
if hasUserGroupRatio {
gRatio = userGroupRatio
}
logContent := fmt.Sprintf("模型固定价格 %.2f,分组倍率 %.2f,操作 %s", modelPrice, gRatio, info.Action)
//gRatio := groupRatio
//if hasUserGroupRatio {
// gRatio = userGroupRatio
//}
logContent := fmt.Sprintf("操作 %s", info.Action)
if len(info.PriceData.OtherRatios) > 0 {
var contents []string
for key, ra := range info.PriceData.OtherRatios {

View File

@@ -377,6 +377,12 @@ export const useLogsData = () => {
other.file_search_call_count || 0,
),
});
if (logs[i]?.content) {
expandDataLocal.push({
key: t('其他详情'),
value: logs[i].content,
});
}
}
if (logs[i].type === 2) {
let modelMapped =