9router/open-sse/providers/registry/iflow.js
decolua aba4c45da6 fix(translator): ESM-safe registry + tool-id pairing + responses max_tokens; add real-creds tests
- translator/index.js: replace require() with static side-effect imports (ESM-safe),
  lazy-init registry maps to survive circular import order
- openai-responses->openai: map max_output_tokens -> max_tokens (avoid leaking field upstream)
- gemini/antigravity -> openai: derive deterministic tool_call id from name so
  functionCall/functionResponse pair correctly (fixes provider tool-pairing 400s)
- add offline unit tests (finish-reason, usage, session-manager, ollama malformed args, const guard)
- add real-creds integration tests (provider-cases + all-formats matrix: 6 inbound formats x 4 scenarios)

Includes co-located provider registry refactor (pricing/capabilities/media providers) and sessionManager updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-15 11:38:43 +07:00

51 lines
1.6 KiB
JavaScript

export default {
id: "iflow",
hidden: true,
priority: 110,
alias: "if",
display: {
name: "iFlow AI",
icon: "water_drop",
color: "#6366F1",
website: "https://iflow.cn",
notice: {
signupUrl: "https://iflow.cn",
},
},
category: "oauth",
transport: {
baseUrl: "https://apis.iflow.cn/v1/chat/completions",
headers: {
"User-Agent": "iFlow-Cli",
},
},
models: [
{ id: "qwen3-coder-plus", name: "Qwen3 Coder Plus" },
{ id: "qwen3-max", name: "Qwen3 Max" },
{ id: "qwen3-vl-plus", name: "Qwen3 VL Plus" },
{ id: "qwen3-max-preview", name: "Qwen3 Max Preview" },
{ id: "qwen3-235b", name: "Qwen3 235B A22B" },
{ id: "qwen3-235b-a22b-instruct", name: "Qwen3 235B A22B Instruct" },
{ id: "qwen3-235b-a22b-thinking-2507", name: "Qwen3 235B A22B Thinking" },
{ id: "qwen3-32b", name: "Qwen3 32B" },
{ id: "kimi-k2", name: "Kimi K2" },
{ id: "deepseek-v3.2", name: "DeepSeek V3.2 Exp" },
{ id: "deepseek-v3.1", name: "DeepSeek V3.1 Terminus" },
{ id: "deepseek-v3", name: "DeepSeek V3 671B" },
{ id: "deepseek-r1", name: "DeepSeek R1" },
{ id: "glm-4.7", name: "GLM 4.7" },
{ id: "iflow-rome-30ba3b", name: "iFlow ROME" },
],
oauth: {
clientId: "10009311001",
clientSecret: "4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",
authorizeUrl: "https://iflow.cn/oauth",
tokenUrl: "https://iflow.cn/oauth/token",
userInfoUrl: "https://iflow.cn/api/oauth/getUserInfo",
extraParams: {
loginMethod: "phone",
type: "phone",
},
refreshLeadMs: 86400000,
},
};