feat: add logging for model details and enhance action assignment in relay tasks
This commit is contained in:
@@ -173,7 +173,6 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
|
|||||||
if hasInputReference {
|
if hasInputReference {
|
||||||
action = constant.TaskActionGenerate
|
action = constant.TaskActionGenerate
|
||||||
}
|
}
|
||||||
info.Action = action
|
|
||||||
if strings.HasPrefix(model, "sora-2") {
|
if strings.HasPrefix(model, "sora-2") {
|
||||||
|
|
||||||
if size == "" {
|
if size == "" {
|
||||||
@@ -199,6 +198,8 @@ func ValidateMultipartDirect(c *gin.Context, info *RelayInfo) *dto.TaskError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info.Action = action
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -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)
|
userQuota, err := model.GetUserQuota(info.UserId, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
taskErr = service.TaskErrorWrapper(err, "get_user_quota_failed", http.StatusInternalServerError)
|
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 {
|
if quota != 0 {
|
||||||
tokenName := c.GetString("token_name")
|
tokenName := c.GetString("token_name")
|
||||||
gRatio := groupRatio
|
//gRatio := groupRatio
|
||||||
if hasUserGroupRatio {
|
//if hasUserGroupRatio {
|
||||||
gRatio = userGroupRatio
|
// gRatio = userGroupRatio
|
||||||
}
|
//}
|
||||||
logContent := fmt.Sprintf("模型固定价格 %.2f,分组倍率 %.2f,操作 %s", modelPrice, gRatio, info.Action)
|
logContent := fmt.Sprintf("操作 %s", info.Action)
|
||||||
if len(info.PriceData.OtherRatios) > 0 {
|
if len(info.PriceData.OtherRatios) > 0 {
|
||||||
var contents []string
|
var contents []string
|
||||||
for key, ra := range info.PriceData.OtherRatios {
|
for key, ra := range info.PriceData.OtherRatios {
|
||||||
|
|||||||
@@ -377,6 +377,12 @@ export const useLogsData = () => {
|
|||||||
other.file_search_call_count || 0,
|
other.file_search_call_count || 0,
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
if (logs[i]?.content) {
|
||||||
|
expandDataLocal.push({
|
||||||
|
key: t('其他详情'),
|
||||||
|
value: logs[i].content,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (logs[i].type === 2) {
|
if (logs[i].type === 2) {
|
||||||
let modelMapped =
|
let modelMapped =
|
||||||
|
|||||||
Reference in New Issue
Block a user