fix: isStream status in error logs instead of hardcoded false (#4195)
This commit is contained in:
@@ -65,4 +65,5 @@ const (
|
|||||||
|
|
||||||
// ContextKeyLanguage stores the user's language preference for i18n
|
// ContextKeyLanguage stores the user's language preference for i18n
|
||||||
ContextKeyLanguage ContextKey = "language"
|
ContextKeyLanguage ContextKey = "language"
|
||||||
|
ContextKeyIsStream ContextKey = "is_stream"
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -389,7 +389,7 @@ func processChannelError(c *gin.Context, channelError types.ChannelError, err *t
|
|||||||
startTime = time.Now()
|
startTime = time.Now()
|
||||||
}
|
}
|
||||||
useTimeSeconds := int(time.Since(startTime).Seconds())
|
useTimeSeconds := int(time.Since(startTime).Seconds())
|
||||||
model.RecordErrorLog(c, userId, channelId, modelName, tokenName, err.MaskSensitiveErrorWithStatusCode(), tokenId, useTimeSeconds, false, userGroup, other)
|
model.RecordErrorLog(c, userId, channelId, modelName, tokenName, err.MaskSensitiveErrorWithStatusCode(), tokenId, useTimeSeconds, common.GetContextKeyBool(c, constant.ContextKeyIsStream), userGroup, other)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -438,6 +438,7 @@ func genBaseRelayInfo(c *gin.Context, request dto.Request) *RelayInfo {
|
|||||||
if request != nil {
|
if request != nil {
|
||||||
isStream = request.IsStream(c)
|
isStream = request.IsStream(c)
|
||||||
}
|
}
|
||||||
|
c.Set(string(constant.ContextKeyIsStream), isStream)
|
||||||
|
|
||||||
// firstResponseTime = time.Now() - 1 second
|
// firstResponseTime = time.Now() - 1 second
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user