MCPcopy Create free account

hub / github.com/123hi123/qwen2api-rs / functions

Functions435 in github.com/123hi123/qwen2api-rs

↓ 1 callersMethodmessage
(&self)
src/error.rs:41
↓ 1 callersFunctionmeta
取上游 model 的 info.meta。
src/request/model_catalog.rs:8
↓ 1 callersFunctionmk
(email: &str, valid: bool, inflight: i64, rl_until: f64, started: f64, finished: f64)
src/account/pool.rs:805
↓ 1 callersFunctionnonStreamChat
(body, msg, bubbleEl)
web/app.js:1202
↓ 1 callersFunctionnormalizeContent
content 可能是字符串或数组(多模态),归一为字符串
web/app.js:1272
↓ 1 callersFunctionopenai_sse_response
(state: AppState, std: StandardRequest, token: String)
src/api/openai.rs:54
↓ 1 callersFunctionparams_to_image_options
從前端參數(ratio/size/width/height)建 ImageOptions。
src/media.rs:640
↓ 1 callersFunctionparse_naked_json_tool_calls
掃描 text 找符合「裸 tool_call JSON」的物件(無 `<tool_call>` 包裝)。 篩選條件(避免把使用者要回的普通 JSON 文字誤判為工具呼叫): - 物件有 `name` 字串欄位,且 name 經 norm_key 後在 registry 內 - 物件有 `argum
src/toolcall/mod.rs:267
↓ 1 callersFunctionparse_one
(json_str: &str, registry: &HashMap<String, String>)
src/toolcall/mod.rs:306
↓ 1 callersMethodper_account_status
各帳號明細(儀表板表格)。 帳號數可達數萬,且儀表板每 3 秒輪詢一次;只回「有負載或異常」的帳號 (inflight>0 / 限流中 / 非 valid),正常閒置帳號不列,最多 500 筆,避免全量序列化拖垮前端。
src/account/pool.rs:707
↓ 1 callersFunctionpollExp
()
web/app.js:239
↓ 1 callersFunctionprocess_task
處理單一任務:生成(帶重試)→ 下載存本地 → 更新狀態。
src/media.rs:598
↓ 1 callersMethodproxy
目前出口代理設定(供管理台顯示)。
src/upstream/client.rs:74
↓ 1 callersFunctionquery_dashboard
面板總覽:summary + by_model + by_surface + 時序。`since_ms`=0 表示全部。
src/stats.rs:207
↓ 1 callersFunctionquery_recent
最近 N 筆明細(id 由大到小)。
src/stats.rs:375
↓ 1 callersFunctionread_proxy_env
依序讀取代理環境變數(含大小寫變體)。
src/config.rs:98
↓ 1 callersMethodrecord
hot-path:非阻塞記錄一筆;通道滿則丟棄並計數。
src/stats.rs:84
↓ 1 callersMethodrefill_round
背景一輪:GC 過期會話 + bootstrap(對前 max_accounts 個帳號觸發回補到 target)。 注意:日常供給已由 acquire 的 consume-triggered refill 承擔,此處僅啟動暖機與淘汰。
src/upstream/chat_id_pool.rs:214
↓ 1 callersFunctionrenderAccPager
分页控制条:显示总数/页码 + 上一页/下一页
web/app.js:825
↓ 1 callersFunctionrenderAccStats
(host, counts)
web/app.js:803
↓ 1 callersFunctionrenderAccTable
(host, accounts)
web/app.js:838
↓ 1 callersFunctionrenderDashExp
Token 過期分布卡片 + 「立即批次刷新」按鈕
web/app.js:252
↓ 1 callersFunctionrenderDashStats
渲染顶部统计卡
web/app.js:309
↓ 1 callersFunctionrenderDashTable
渲染账号并发详情表
web/app.js:365
↓ 1 callersFunctionrenderGallery
渲染媒体画廊(任务卡片)
web/app.js:1505
↓ 1 callersFunctionrenderMsg
渲染单条消息节点
web/app.js:1286
↓ 1 callersFunctionrenderRichText
* 渲染富文本:转义后把 markdown 图片 / 裸图片 URL 转成 <img>。 * 仅处理图片,不做完整 markdown,以保持轻量与安全。
web/app.js:1333
↓ 1 callersFunctionrenderStatsByModel
(host, d)
web/app.js:613
↓ 1 callersFunctionrenderStatsBySurface
(host, d)
web/app.js:639
↓ 1 callersFunctionrenderStatsChart
趋势图:请求数(面积折线)+ 旁注 token / 平均延迟
web/app.js:557
↓ 1 callersFunctionrenderStatsOverview
(box, d)
web/app.js:533
↓ 1 callersFunctionrenderStatsRecent
(host, d)
web/app.js:652
↓ 1 callersFunctionrenderTaskCard
(t, isVideo)
web/app.js:1519
↓ 1 callersFunctionrender_message
渲染歷史中的 assistant tool_use / tool 訊息為文字(保留語意)。
src/request/prompt_builder.rs:103
↓ 1 callersMethodrequeue_stale
啟動時把殘留的 running(前次中斷)重新排隊。
src/media.rs:344
↓ 1 callersFunctionresolve_model
從 model_aliases 解析實際 base model;命中則回映射值,否則原樣返回。
src/config.rs:208
↓ 1 callersFunctionresponses_sse
(state: AppState, std: StandardRequest, token: String)
src/api/responses.rs:103
↓ 1 callersFunctionresponses_to_chat_body
把 Responses 的 input/instructions 轉成 chat messages(再交給通用 builder)。
src/api/responses.rs:21
↓ 1 callersFunctionrouter
()
web/app.js:163
↓ 1 callersFunctionrun_completion
主入口:回傳 OutEvent 串流。stream 與 non-stream 處理皆消費此串流。
src/execution/mod.rs:186
↓ 1 callersFunctionrun_openai
共用:依 stream 決定串流或 JSON 回應。
src/api/openai.rs:37
↓ 1 callersMethodsave_bytes
(&self, filename: &str, content_type: &str, bytes: &[u8], purpose: &str)
src/context/file_store.rs:35
↓ 1 callersFunctionscrape_urls
從上游回應文字抓圖片/影片 URL(合併原 images.rs / videos.rs 的抓取邏輯)。
src/media.rs:63
↓ 1 callersFunctionsend
()
web/app.js:1153
↓ 1 callersFunctionsetTxt
(id, val)
web/app.js:1724
↓ 1 callersMethodset_global_max_inflight
(&self, v: i64)
src/account/pool.rs:256
↓ 1 callersMethodset_max_inflight
(&self, v: i64)
src/account/pool.rs:245
↓ 1 callersMethodset_min_interval
風控:設定同帳號最小間隔(毫秒),即時生效。bump 世代以觸發 acquire 時整建索引。
src/account/pool.rs:264
↓ 1 callersMethodset_proxy
即時切換出口代理(重建 client 並原子抽換)。None/空字串 = 清除。
src/upstream/client.rs:63
↓ 1 callersMethodset_upstream_proxy
設定出口全局代理:即時切換 client + 持久化(None/空 = 清除,回退環境變數)。
src/state.rs:121
↓ 1 callersFunctionshort_id
產生短 id(hex 前 n 碼),對齊 Python uuid4().hex[:n]。
src/util.rs:41
↓ 1 callersFunctionsign_put
對 OSS PUT 請求做 V4 簽名,回傳 (authorization, x-oss-date, x-oss-content-sha256)。
src/context/oss.rs:44
↓ 1 callersFunctionspawn_backup
fire-and-forget:下載 CDN 影片到本地並在媒體庫記一筆 done(供畫廊與防丟失)。
src/api/videos.rs:70
↓ 1 callersFunctionspawn_backup
(state: AppState, urls: Vec<String>, prompt: String, ratio: String, size: String, caller: Option<String>)
src/api/images.rs:97
↓ 1 callersFunctionsplit_json_objects
從一個 tool_call 區塊(內含 1+ 個 JSON 物件、可能用 `,` 或換行分隔、可能未閉合) 切出所有「頂層 JSON 物件」的 byte 範圍 `(start, end_inclusive)`。
src/toolcall/mod.rs:157
↓ 1 callersFunctionsplit_model_action
從 "{model}:{action}" 拆出 (model, action)。
src/api/gemini.rs:20
↓ 1 callersFunctionstatusBadge
dashboard 状态字符串 -> 徽章(valid绿 / rate_limited橙 / 其他红)
web/app.js:392
↓ 1 callersFunctionstreamChat
(body, msg, bubbleEl)
web/app.js:1223
↓ 1 callersMethodsubmit
提交任務(排隊),回傳 task id 並喚醒 worker。
src/media.rs:552
↓ 1 callersFunctionsuffix_table
後綴 → (chat_type, force_thinking, mode 標籤)
src/request/model_modes.rs:13
↓ 1 callersMethodsurface
(&self)
src/media.rs:41
↓ 1 callersFunctionsvgAreaChart
* 纯 SVG 面积折线图(无外部依赖)。values:数值数组;opts.tipFmt 生成 hover 提示。
web/app.js:580
↓ 1 callersMethodtake_queued
取出排隊中的任務(標記為 running),回傳其 id。單一 dispatcher 呼叫,無競態。
src/media.rs:325
↓ 1 callersMethodto_admin_json
管理台列表用的序列化(含執行期狀態)。
src/account/account.rs:144
↓ 1 callersMethodtoken_and_password_of
取得某帳號的 (token, password)(依 email)——refresh 流程用。 password 是註冊時的明文(accounts.json 直接存);signin 自己 sha256 後送上游。
src/account/pool.rs:332
↓ 1 callersFunctiontool_call_chunk
(index: usize, tc: &ParsedToolCall)
src/execution/translator.rs:100
↓ 1 callersFunctionupload_file
上傳本地檔案 bytes 到 Qwen 上游,回傳可放進 payload.messages[].files 的 remote_ref。
src/context/oss.rs:90
↓ 1 callersFunctionusage_json
(u: &Usage)
src/execution/translator.rs:112
↓ 1 callersFunctionutc_iso8601_basic
UTC 時間格式化為 (ISO8601 basic "YYYYMMDDTHHMMSSZ", date "YYYYMMDD")。 自行做曆法換算以避免引入 chrono(Howard Hinnant civil_from_days 演算法)。
src/util.rs:57
↓ 1 callersFunctionv4_uri_encode
oss2 的 __v4_uri_encode:保留 A-Za-z0-9 _-~. ;ignore_slashes 時保留 '/';其餘 %XX 大寫。
src/context/oss.rs:15
↓ 1 callersFunctionwriter_loop
背景寫入迴圈:阻塞收第一筆 → 盡量 drain 同批 → 一次交易寫入。
src/stats.rs:144
Function_keepalive
()
src/execution/presenter.rs:195
Functionaccounts_exp_summary
JWT exp 分桶摘要:給前端 dashboard 顯示「N 天內過期 X 個」警示。 JWT payload 是 base64(json{id, exp, last_password_change});解 exp 後分桶。
src/api/admin.rs:272
Methodacquire
非阻塞取得帳號。preferred 命中時優先;exclude 內的 email 跳過。
src/account/pool.rs:365
Methodacquire_wait
阻塞取得帳號(有截止時間)。
src/account/pool.rs:526
Functionactivate_account
帳號激活(已移除)。
src/api/admin.rs:368
Functionadd_account
(State(state): State<AppState>, headers: HeaderMap, body: axum::body::Bytes)
src/api/admin.rs:109
Functionaliyun_quota_exceeded_is_swap_retryable
()
src/upstream/executor.rs:457
Functionanswer_content_detection_excludes_thinking_phase
()
src/upstream/sse.rs:354
Functionanswer_delta_extracts_phase_content_status
()
src/upstream/sse.rs:224
Functionanthropic_tool_use_block
給 Anthropic tool_use id 用。
src/execution/formatters.rs:112
Functionbraces_inside_strings_dont_confuse_scanner
()
src/toolcall/mod.rs:502
Functionbuild_chat_payload
(args: &BuildPayloadArgs)
src/upstream/payload.rs:34
Functionchar_len
Python len():計算 Unicode 標量數(非 bytes)。
src/util.rs:51
Functionchat_completions
( State(state): State<AppState>, headers: HeaderMap, Query(query): Query<HashMap<String, String>>,
src/api/openai.rs:17
Methodclassify_and_mark
依錯誤訊息分類並標記帳號狀態。
src/upstream/executor.rs:371
Functioncompact_schema
壓縮 JSON schema(移除冗長欄位、截斷),對齊原版 compact_schema 精神。
src/toolcall/mod.rs:80
Functioncooldown_blocks_immediate_reacquire
()
src/account/pool.rs:896
Functioncount_tokens
(text: &str)
src/execution/mod.rs:25
Functioncreate
( State(state): State<AppState>, headers: HeaderMap, Query(query): Query<HashMap<String, String>>,
src/api/embeddings.rs:40
Functioncreate
( State(state): State<AppState>, headers: HeaderMap, Query(query): Query<HashMap<String, String>>,
src/api/responses.rs:45
Functioncreate_key
(State(state): State<AppState>, headers: HeaderMap)
src/api/admin.rs:382
Functioncreate_user
(State(state): State<AppState>, headers: HeaderMap, body: axum::body::Bytes)
src/api/admin.rs:588
Functiondata_inspection_false_positive_is_swap_retryable
()
src/upstream/executor.rs:500
Methoddefault
()
src/upstream/executor.rs:50
Methoddefault
()
src/upstream/client.rs:317
Functiondefault_quota
()
src/auth.rs:21
Functiondefault_status
()
src/account/account.rs:52
Functiondefault_valid
()
src/account/account.rs:7
Functiondelete_account
(State(state): State<AppState>, headers: HeaderMap, Path(email): Path<String>)
src/api/admin.rs:162
← previousnext →201–300 of 435, ranked by callers