MCPcopy Create free account

hub / github.com/Rfym21/Qwen2API / functions

Functions346 in github.com/Rfym21/Qwen2API

↓ 170 callersMethoderror
(message, module = '', emoji = '', data = null)
src/utils/logger.js:274
↓ 85 callersMethodinfo
(message, module = '', emoji = '', data = null)
src/utils/logger.js:266
↓ 31 callersMethodwarn
(message, module = '', emoji = '', data = null)
src/utils/logger.js:270
↓ 26 callersMethodsuccess
(message, module = '', data = null)
src/utils/logger.js:279
↓ 16 callersFunctiongenerateUUID
()
src/utils/tools.js:44
↓ 12 callersFunctionensureConnection
()
src/utils/redis.js:321
↓ 12 callersFunctiongetChatBaseUrl
()
src/utils/proxy-helper.js:86
↓ 12 callersFunctiongetProxyAgent
(account)
src/utils/proxy-helper.js:59
↓ 12 callersFunctionwriteAnthropicEvent
(res, event, data)
src/controllers/anthropic.js:353
↓ 11 callersFunctionpushTaskID
(taskID)
src/controllers/chat.image.video.js:489
↓ 10 callersFunctionparseUpstreamImageError
(data)
src/controllers/chat.image.video.js:93
↓ 9 callersMethodlog
* 通用日志方法 * @param {string} level - 日志级别 * @param {string} message - 日志消息 * @param {string} module - 模块名 * @param {string} emoji - Emoji标签
src/utils/logger.js:238
↓ 9 callersMethodsetAccounts
* 设置账户列表 * @param {Array} accounts - 账户列表
src/utils/account-rotator.js:24
↓ 8 callersFunctionextractResourceUrlFromPayload
(payload)
src/controllers/chat.image.video.js:298
↓ 8 callersMethodgenerateMarkdownTable
* 生成 Markdown 表格 * @param {Array} websites - 网站信息数组 * @param {string} mode - 模式 ('table' 或 'text') * @returns {Promise<string>} Markdow
src/utils/account.js:613
↓ 8 callersFunctionpushResponseID
(responseID)
src/controllers/chat.image.video.js:425
↓ 8 callersFunctionreturnResponse
(res, model, content, stream)
src/controllers/chat.image.video.js:1525
↓ 8 callersMethodvalidateToken
* 验证令牌是否有效 * @param {string} token - JWT令牌 * @returns {Object|null} 解码后的令牌信息或null
src/utils/token-manager.js:75
↓ 7 callersFunctionbuildPublicModelData
(model, suffix = '')
src/controllers/models.js:10
↓ 7 callersMethodgetAccount
* 获取下一个可用的账户对象(包含 proxy 等完整字段) * @returns {Object|null} 账户对象或 null
src/utils/account.js:482
↓ 7 callersMethodsaveAccount
* 保存单个账户数据 * @param {string} email - 邮箱 * @param {Object} accountData - 账户数据 * @returns {Promise<boolean>} 保存是否成功
src/utils/data-persistence.js:51
↓ 7 callersFunctionsleep
(ms)
src/utils/tools.js:15
↓ 7 callersFunctionwriteContentDelta
(text)
src/controllers/chat.js:138
↓ 6 callersFunctioncountTokens
* 使用tiktoken进行精准token计数 * @param {string} text - 要计数的文本 * @param {string} model - 模型名称,默认为gpt-3.5-turbo * @returns {number} 精确的token数量
src/utils/precise-tokenizer.js:14
↓ 6 callersMethodgetAllAccountKeys
* 获取所有账户信息 * @returns {Array} 账户列表
src/utils/account.js:652
↓ 6 callersFunctionparseToolCallsFromText
(fullText)
src/utils/tool-prompt.js:231
↓ 6 callersFunctionsendChatRequest
(body)
src/utils/request.js:34
↓ 6 callersFunctionsendOpenAIErrorResponse
(res, error)
src/controllers/chat.image.video.js:649
↓ 5 callersMethod_ensureDataFileExists
* 确保数据文件存在 * @private
src/utils/data-persistence.js:333
↓ 5 callersFunctionextractResponseIDsFromPayload
(payload)
src/controllers/chat.image.video.js:398
↓ 5 callersFunctionextractVideoTaskIdentifiersFromPayload
(payload)
src/controllers/chat.image.video.js:453
↓ 5 callersFunctionisChatType
(model)
src/utils/chat-helpers.js:189
↓ 5 callersMethodlogin
* 用户登录(委托给 TokenManager) * @param {string} email - 邮箱 * @param {string} password - 密码 * @returns {Promise<string|null>} 令牌或null
src/utils/account.js:662
↓ 5 callersFunctionparserModel
(model)
src/utils/chat-helpers.js:238
↓ 5 callersFunctionsetResponseHeaders
(res, stream)
src/controllers/chat.js:15
↓ 5 callersFunctionupdateActivity
()
src/utils/redis.js:170
↓ 5 callersFunctionupdateBatchTaskMessage
(task)
src/routes/accounts.js:159
↓ 4 callersMethod_initializeCliAccount
* 初始化CLI账户 * @param {Object} account - 账户对象 * @private
src/utils/account.js:201
↓ 4 callersMethod_resetDailyCounters
* Daily 00:00 reset: CLI request counters + chat/cli daily stats. * Before zeroing, snapshot yesterday into account.statsHistory and prune *
src/utils/account.js:285
↓ 4 callersFunctionapplyPayload
(payload)
src/controllers/chat.image.video.js:878
↓ 4 callersFunctionapplyProxyToFetchOptions
(fetchOptions = {}, account)
src/utils/proxy-helper.js:116
↓ 4 callersFunctionbuildAxiosErrorLog
(error)
src/controllers/chat.image.video.js:84
↓ 4 callersFunctionbuildInternalMediaItem
(mediaType, mediaURL)
src/controllers/chat.image.video.js:730
↓ 4 callersFunctionbuildNormalizedMediaItem
(mediaType, url)
src/utils/chat-helpers.js:117
↓ 4 callersFunctionbuildVideoContent
(contentUrl)
src/controllers/chat.image.video.js:583
↓ 4 callersFunctioncleanup
()
src/utils/redis.js:140
↓ 4 callersFunctionclearIdleTimer
()
src/utils/redis.js:112
↓ 4 callersFunctionconsumeUpstream
(upstream, onDelta)
src/controllers/anthropic.js:301
↓ 4 callersFunctioncreateUsageObject
* 创建精准的usage对象 * @param {Array|string} promptMessages - 提示消息或文本 * @param {string} completionText - 完成文本 * @param {object} realUsage - 真实的usage数据(如果
src/utils/precise-tokenizer.js:78
↓ 4 callersFunctiongenerateImageVideoResult
(payload)
src/controllers/chat.image.video.js:1243
↓ 4 callersFunctiongetSsxmodItna
* 获取当前 ssxmod_itna * @returns {string} ssxmod_itna 值
src/utils/ssxmod-manager.js:60
↓ 4 callersFunctiongetSsxmodItna2
* 获取当前 ssxmod_itna2 * @returns {string} ssxmod_itna2 值
src/utils/ssxmod-manager.js:68
↓ 4 callersFunctionparseSsePayloads
(buffer, flush = false)
src/controllers/chat.image.video.js:183
↓ 3 callersFunctionJwtDecode
(token)
src/utils/tools.js:29
↓ 3 callersFunction_formatDateKey
(offsetDays)
src/utils/account.js:51
↓ 3 callersMethod_isAccountAvailable
* 检查账户是否可用 * @param {Object} account - 账户对象 * @returns {boolean} 是否可用 * @private
src/utils/account-rotator.js:193
↓ 3 callersMethod_recordUsage
* 记录账户使用 * @param {string} email - 邮箱地址 * @private
src/utils/account-rotator.js:264
↓ 3 callersMethodaccumulateStats
* 累计 daily stats(per-account) * 调用方:chat.js / anthropic.js / cli.chat.js 在成功消费完上游 usage 后 * 注意:PM2_INSTANCES>1 时各 worker 各持一份 in-memory 副本(已
src/utils/account.js:713
↓ 3 callersMethodautoRefreshTokens
* 自动刷新即将过期的令牌 * @param {number} thresholdHours - 过期阈值(小时) * @returns {Promise<number>} 成功刷新的令牌数量
src/utils/account.js:408
↓ 3 callersFunctionbuildUpstreamCookieHeader
(token)
src/controllers/chat.image.video.js:21
↓ 3 callersMethodcacheIsExist
(signature)
src/utils/img-caches.js:11
↓ 3 callersFunctioncloseTextBlockIfOpen
()
src/controllers/anthropic.js:404
↓ 3 callersFunctioncloseThinkingBlockIfOpen
()
src/controllers/anthropic.js:414
↓ 3 callersFunctioncollectNestedValues
(payload, visited = new Set())
src/controllers/chat.image.video.js:160
↓ 3 callersFunctioncreateDefaultStats
()
src/utils/account.js:11
↓ 3 callersMethoddestroy
()
src/utils/account.js:596
↓ 3 callersFunctiondisconnectRedis
()
src/utils/redis.js:296
↓ 3 callersFunctionemitTextDelta
(text)
src/controllers/anthropic.js:448
↓ 3 callersFunctionextractVideoInfoFromChatDetail
(chatDetail, responseIDs = [])
src/controllers/chat.image.video.js:1069
↓ 3 callersFunctiongenerateCookies
(realData = null, fingerprintOptions = {})
src/utils/cookie-generator.js:313
↓ 3 callersFunctiongetBatchTaskSnapshot
(task)
src/routes/accounts.js:127
↓ 3 callersFunctiongetChatDetail
(chatID, token)
src/controllers/chat.image.video.js:1033
↓ 3 callersFunctiongetLatestModels
(force = false)
src/models/models-map.js:18
↓ 3 callersFunctionisJson
(str)
src/utils/tools.js:6
↓ 3 callersMethodisTokenExpiringSoon
* 检查令牌是否即将过期 * @param {string} token - JWT令牌 * @param {number} thresholdHours - 过期阈值(小时) * @returns {boolean} 是否即将过期
src/utils/token-manager.js:102
↓ 3 callersFunctionisValidProxyUrl
(url)
src/utils/proxy-helper.js:18
↓ 3 callersMethodnetwork
(message, module = '', data = null)
src/utils/logger.js:283
↓ 3 callersFunctionnormalizeCliErrorDetails
* 尝试解析 CLI 错误详情 * @param {*} data - 原始响应体 * @returns {Promise<*>} 可序列化的详情
src/controllers/cli.chat.js:204
↓ 3 callersFunctionnormalizeOpenAIImageVideoSize
(size)
src/controllers/chat.image.video.js:627
↓ 3 callersFunctionparseToolCallPayload
(raw)
src/utils/tool-prompt.js:204
↓ 3 callersMethodreadResponseBody
* 读取响应体 * @param {Response} response - Fetch 响应对象 * @returns {Promise<*>} 响应体
src/utils/cli.manager.js:43
↓ 3 callersMethodrecordAccountError
* 记录账户错误(仅用于 UI warn 指示,不影响 cooldown) * HTTP 4xx/5xx 走这里——上游主动拒绝,账户本身有效 * @param {string} email - 邮箱地址 * @param {string|number} [code]
src/utils/account.js:698
↓ 3 callersMethodrecordAccountFailure
* 记录账户传输层失败(影响 cooldown) * 仅在 timeout/ECONNRESET 等传输层错误调用——HTTP 4xx/5xx 走 recordAccountError * @param {string} email - 邮箱地址 * @param {s
src/utils/account.js:688
↓ 3 callersMethodrecordFailure
* 记录账户传输层失败(影响 cooldown) * 仅在传输层错误(timeout/ECONNRESET 等)调用——HTTP 4xx/5xx 走 recordError * @param {string} email - 邮箱地址 * @param {string|number
src/utils/account-rotator.js:106
↓ 3 callersMethodrefreshToken
* 刷新单个账户的令牌 * @param {Object} account - 账户对象 {email, password, token, expires} * @returns {Promise<Object|null>} 更新后的账户对象或null
src/utils/token-manager.js:130
↓ 3 callersMethodresetFailures
* 重置账户失败计数(清除 cooldown) * 注意:不清理 lastErrorAt/lastErrorCode——它们由 endpoint 的 15 分钟窗口管理 * @param {string} email - 邮箱地址
src/utils/account-rotator.js:142
↓ 3 callersFunctionresolveRequestedModel
(model, chatType)
src/controllers/chat.image.video.js:832
↓ 3 callersMethodsaveSettings
* 保存运行时设置(部分合并) * @param {Object} partial - 要写入的字段 * @returns {Promise<boolean>} 保存是否成功
src/utils/data-persistence.js:100
↓ 3 callersFunctionscheduleBatchTaskCleanup
(taskId)
src/routes/accounts.js:30
↓ 3 callersFunctionuploadFileToQwenOss
(fileBuffer, originalFilename, authToken, account)
src/utils/upload.js:246
↓ 3 callersFunctionvalidateApiKey
(providedKey)
src/middlewares/authorization.js:8
↓ 3 callersFunctionwriteToolCallsDelta
(calls)
src/controllers/chat.js:195
↓ 2 callersMethod_getAvailableAccounts
* 获取可用账户列表 * @private
src/utils/account-rotator.js:183
↓ 2 callersMethod_saveToRedis
* 保存到 Redis * @private
src/utils/data-persistence.js:213
↓ 2 callersFunctionaccumulateUpstream
(upstreamResponse)
src/controllers/chat.js:543
↓ 2 callersFunctionappendRetryHint
(body, hint)
src/controllers/anthropic.js:264
↓ 2 callersFunctionattributeChatUsage
(account, usage)
src/controllers/chat.js:88
↓ 2 callersFunctionattributeChatUsage
(account, promptTokens, completionTokens)
src/controllers/anthropic.js:26
↓ 2 callersFunctionattributeCliUsage
(email, usage)
src/controllers/cli.chat.js:11
↓ 2 callersFunctionbuildOpenAIImageResultItem
(contentUrl, responseFormat)
src/controllers/chat.image.video.js:688
next →1–100 of 346, ranked by callers