|
|
@@ -254,6 +254,12 @@ func OaiStreamHandler(c *gin.Context, resp *http.Response, info *relaycommon.Rel
|
|
|
if !containStreamUsage {
|
|
|
usage, _ = service.ResponseText2Usage(responseTextBuilder.String(), info.UpstreamModelName, info.PromptTokens)
|
|
|
usage.CompletionTokens += toolCount * 7
|
|
|
+ } else {
|
|
|
+ if info.ChannelType == common.ChannelTypeDeepSeek {
|
|
|
+ if usage.PromptCacheHitTokens != 0 {
|
|
|
+ usage.PromptTokensDetails.CachedTokens = usage.PromptCacheHitTokens
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if info.ShouldIncludeUsage && !containStreamUsage {
|