feat: add reasoning effort logging and display
- Add `ReasoningEffort` field to `RelayInfo` struct - Update log generation to include reasoning effort in admin info - Modify logs table component to display reasoning effort when available - Preserve reasoning effort information during request processing
This commit is contained in:
@@ -127,7 +127,8 @@ func (a *Adaptor) ConvertRequest(c *gin.Context, info *relaycommon.RelayInfo, re
|
|||||||
request.ReasoningEffort = "medium"
|
request.ReasoningEffort = "medium"
|
||||||
request.Model = strings.TrimSuffix(request.Model, "-medium")
|
request.Model = strings.TrimSuffix(request.Model, "-medium")
|
||||||
}
|
}
|
||||||
info.UpstreamModelName = request.Model
|
info.ReasoningEffort = request.ReasoningEffort
|
||||||
|
//info.UpstreamModelName = request.Model
|
||||||
}
|
}
|
||||||
if request.Model == "o1" || request.Model == "o1-2024-12-17" || strings.HasPrefix(request.Model, "o3") {
|
if request.Model == "o1" || request.Model == "o1-2024-12-17" || strings.HasPrefix(request.Model, "o3") {
|
||||||
//修改第一个Message的内容,将system改为developer
|
//修改第一个Message的内容,将system改为developer
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ type RelayInfo struct {
|
|||||||
RealtimeTools []dto.RealTimeTool
|
RealtimeTools []dto.RealTimeTool
|
||||||
IsFirstRequest bool
|
IsFirstRequest bool
|
||||||
AudioUsage bool
|
AudioUsage bool
|
||||||
|
ReasoningEffort string
|
||||||
ChannelSetting map[string]interface{}
|
ChannelSetting map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ func GenerateTextOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, m
|
|||||||
other["frt"] = float64(relayInfo.FirstResponseTime.UnixMilli() - relayInfo.StartTime.UnixMilli())
|
other["frt"] = float64(relayInfo.FirstResponseTime.UnixMilli() - relayInfo.StartTime.UnixMilli())
|
||||||
adminInfo := make(map[string]interface{})
|
adminInfo := make(map[string]interface{})
|
||||||
adminInfo["use_channel"] = ctx.GetStringSlice("use_channel")
|
adminInfo["use_channel"] = ctx.GetStringSlice("use_channel")
|
||||||
|
if relayInfo.ReasoningEffort != "" {
|
||||||
|
adminInfo["reasoning_effort"] = relayInfo.ReasoningEffort
|
||||||
|
}
|
||||||
other["admin_info"] = adminInfo
|
other["admin_info"] = adminInfo
|
||||||
return other
|
return other
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -608,7 +608,12 @@ const LogsTable = () => {
|
|||||||
key: t('计费过程'),
|
key: t('计费过程'),
|
||||||
value: content,
|
value: content,
|
||||||
});
|
});
|
||||||
|
if (other?.reasoning_effort) {
|
||||||
|
expandDataLocal.push({
|
||||||
|
key: t('Reasoning Effort'),
|
||||||
|
value: other.reasoning_effort,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
expandDatesLocal[logs[i].key] = expandDataLocal;
|
expandDatesLocal[logs[i].key] = expandDataLocal;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user