mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-27 14:28:37 +00:00
feat: Add ContextKeyLocalCountTokens and update ResponseText2Usage to use context in multiple channels
This commit is contained in:
@@ -183,7 +183,7 @@ func OaiStreamHandler(c *gin.Context, info *relaycommon.RelayInfo, resp *http.Re
|
||||
}
|
||||
|
||||
if !containStreamUsage {
|
||||
usage = service.ResponseText2Usage(responseTextBuilder.String(), info.UpstreamModelName, info.PromptTokens)
|
||||
usage = service.ResponseText2Usage(c, responseTextBuilder.String(), info.UpstreamModelName, info.PromptTokens)
|
||||
usage.CompletionTokens += toolCount * 7
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user