feat: endpoint type log

This commit is contained in:
Seefs
2025-10-13 22:25:39 +08:00
parent 7391b15b4b
commit 9718568179
7 changed files with 83 additions and 19 deletions
+7 -1
View File
@@ -13,6 +13,9 @@ import (
func GenerateTextOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, modelRatio, groupRatio, completionRatio float64,
cacheTokens int, cacheRatio float64, modelPrice float64, userGroupRatio float64) map[string]interface{} {
other := make(map[string]interface{})
if relayInfo != nil && relayInfo.RelayFormat != "" {
other["relay_format"] = string(relayInfo.RelayFormat)
}
other["model_ratio"] = modelRatio
other["group_ratio"] = groupRatio
other["completion_ratio"] = completionRatio
@@ -78,8 +81,11 @@ func GenerateClaudeOtherInfo(ctx *gin.Context, relayInfo *relaycommon.RelayInfo,
return info
}
func GenerateMjOtherInfo(priceData types.PerCallPriceData) map[string]interface{} {
func GenerateMjOtherInfo(relayInfo *relaycommon.RelayInfo, priceData types.PerCallPriceData) map[string]interface{} {
other := make(map[string]interface{})
if relayInfo != nil && relayInfo.RelayFormat != "" {
other["relay_format"] = string(relayInfo.RelayFormat)
}
other["model_price"] = priceData.ModelPrice
other["group_ratio"] = priceData.GroupRatioInfo.GroupRatio
if priceData.GroupRatioInfo.HasSpecialRatio {