feat: claude web search tool 计费

This commit is contained in:
creamlike1024
2025-07-15 18:57:22 +08:00
parent 77da33de4f
commit 961bc874d2
4 changed files with 38 additions and 4 deletions

View File

@@ -745,6 +745,10 @@ func HandleClaudeResponseData(c *gin.Context, info *relaycommon.RelayInfo, claud
responseData = data
}
if claudeResponse.Usage.ServerToolUse != nil && claudeResponse.Usage.ServerToolUse.WebSearchRequests > 0 {
c.Set("claude_web_search_requests", claudeResponse.Usage.ServerToolUse.WebSearchRequests)
}
common.IOCopyBytesGracefully(c, nil, responseData)
return nil
}