mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 04:03:18 +00:00
feat: log shows request conversion
This commit is contained in:
@@ -70,9 +70,30 @@ func GenerateTextOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, m
|
||||
|
||||
other["admin_info"] = adminInfo
|
||||
appendRequestPath(ctx, relayInfo, other)
|
||||
appendRequestConversionChain(relayInfo, other)
|
||||
return other
|
||||
}
|
||||
|
||||
func appendRequestConversionChain(relayInfo *relaycommon.RelayInfo, other map[string]interface{}) {
|
||||
if relayInfo == nil || other == nil {
|
||||
return
|
||||
}
|
||||
if len(relayInfo.RequestConversionChain) == 0 {
|
||||
return
|
||||
}
|
||||
chain := make([]string, 0, len(relayInfo.RequestConversionChain))
|
||||
for _, f := range relayInfo.RequestConversionChain {
|
||||
if f == "" {
|
||||
continue
|
||||
}
|
||||
chain = append(chain, string(f))
|
||||
}
|
||||
if len(chain) == 0 {
|
||||
return
|
||||
}
|
||||
other["request_conversion"] = chain
|
||||
}
|
||||
|
||||
func GenerateWssOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, usage *dto.RealtimeUsage, modelRatio, groupRatio, completionRatio, audioRatio, audioCompletionRatio, modelPrice, userGroupRatio float64) map[string]interface{} {
|
||||
info := GenerateTextOtherInfo(ctx, relayInfo, modelRatio, groupRatio, completionRatio, 0, 0.0, modelPrice, userGroupRatio)
|
||||
info["ws"] = true
|
||||
|
||||
Reference in New Issue
Block a user