MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / attributeCliUsage

Function attributeCliUsage

src/controllers/cli.chat.js:11–22  ·  view source on GitHub ↗
(email, usage)

Source from the content-addressed store, hash-verified

9 * @param {string} email - 账户邮箱
10 * @param {Object} usage - upstream usage { prompt_tokens, completion_tokens }
11 */
12const attributeCliUsage = (email, usage) => {
13 if (!email) return
14 try {
15 accountManager.accumulateStats(email, 'cli', {
16 calls: 1,
17 input: Number(usage?.prompt_tokens) || 0,
18 output: Number(usage?.completion_tokens) || 0
19 })
20 } catch (e) {
21 // 静默
22 }
23}
24
25const MODEL_REDIRECT = {

Callers 1

handleCliChatCompletionFunction · 0.85

Calls 1

accumulateStatsMethod · 0.80

Tested by

no test coverage detected