当 provider 报错时,清除 needsRefresh 和 refreshCount 标记,防止健康检查逻辑陷入刷新循环导致节点卡死。同时更新 provider-models.js 中的模型列表,添加 gpt-5.4-mini 模型,并更新项目版本号至 2.11.8。
128 lines
3.2 KiB
JavaScript
128 lines
3.2 KiB
JavaScript
/**
|
|
* 各提供商支持的模型列表
|
|
* 用于前端UI选择不支持的模型
|
|
*/
|
|
|
|
export const PROVIDER_MODELS = {
|
|
'gemini-cli-oauth': [
|
|
'gemini-2.5-flash',
|
|
'gemini-2.5-flash-lite',
|
|
'gemini-2.5-pro',
|
|
'gemini-2.5-pro-preview-06-05',
|
|
'gemini-2.5-flash-preview-09-2025',
|
|
'gemini-3-pro-preview',
|
|
'gemini-3-flash-preview',
|
|
'gemini-3.1-pro-preview',
|
|
'gemini-3.1-flash-lite-preview',
|
|
],
|
|
'gemini-antigravity': [
|
|
'gemini-3-flash',
|
|
'gemini-3.1-pro-high',
|
|
'gemini-3.1-pro-low',
|
|
'gemini-3.1-flash-image',
|
|
'gemini-3-flash-agent',
|
|
'gemini-2.5-flash',
|
|
'gemini-2.5-flash-lite',
|
|
'gemini-2.5-flash-thinking',
|
|
'gemini-claude-sonnet-4-6',
|
|
'gemini-claude-opus-4-6-thinking',
|
|
],
|
|
'claude-custom': [],
|
|
'claude-kiro-oauth': [
|
|
'claude-haiku-4-5',
|
|
'claude-opus-4-6',
|
|
'claude-sonnet-4-6',
|
|
'claude-opus-4-5',
|
|
'claude-opus-4-5-20251101',
|
|
'claude-sonnet-4-5',
|
|
'claude-sonnet-4-5-20250929',
|
|
'claude-sonnet-4-20250514',
|
|
'claude-3-7-sonnet-20250219'
|
|
],
|
|
'openai-custom': [],
|
|
'openaiResponses-custom': [],
|
|
'openai-qwen-oauth': [
|
|
'qwen3-coder-plus',
|
|
'qwen3-coder-flash',
|
|
'coder-model',
|
|
'vision-model'
|
|
],
|
|
'openai-iflow': [
|
|
// iFlow 特有模型
|
|
'iflow-rome-30ba3b',
|
|
// Qwen 模型
|
|
'qwen3-coder-plus',
|
|
'qwen3-max',
|
|
'qwen3-vl-plus',
|
|
'qwen3-max-preview',
|
|
'qwen3-32b',
|
|
'qwen3-235b-a22b-thinking-2507',
|
|
'qwen3-235b-a22b-instruct',
|
|
'qwen3-235b',
|
|
// Kimi 模型
|
|
'kimi-k2-0905',
|
|
'kimi-k2',
|
|
// GLM 模型
|
|
'glm-4.6',
|
|
// DeepSeek 模型
|
|
'deepseek-v3.2',
|
|
'deepseek-r1',
|
|
'deepseek-v3',
|
|
// 手动定义
|
|
'glm-4.7',
|
|
'glm-5',
|
|
'kimi-k2.5',
|
|
'minimax-m2.1',
|
|
'minimax-m2.5',
|
|
],
|
|
'openai-codex-oauth': [
|
|
'gpt-5',
|
|
'gpt-5-codex',
|
|
'gpt-5-codex-mini',
|
|
'gpt-5.1',
|
|
'gpt-5.1-codex',
|
|
'gpt-5.1-codex-mini',
|
|
'gpt-5.1-codex-max',
|
|
'gpt-5.2',
|
|
'gpt-5.2-codex',
|
|
'gpt-5.3-codex',
|
|
'gpt-5.3-codex-spark',
|
|
'gpt-5.4',
|
|
'gpt-5.4-mini',
|
|
],
|
|
'forward-api': [],
|
|
'grok-custom': [
|
|
'grok-3',
|
|
'grok-3-mini',
|
|
'grok-3-thinking',
|
|
'grok-4',
|
|
'grok-4-mini',
|
|
'grok-4-thinking',
|
|
'grok-4-heavy',
|
|
'grok-4.1-mini',
|
|
'grok-4.1-fast',
|
|
'grok-4.1-expert',
|
|
'grok-4.1-thinking',
|
|
'grok-4.20-beta',
|
|
'grok-imagine-1.0',
|
|
'grok-imagine-1.0-edit',
|
|
'grok-imagine-1.0-video'
|
|
]
|
|
};
|
|
|
|
/**
|
|
* 获取指定提供商类型支持的模型列表
|
|
* @param {string} providerType - 提供商类型
|
|
* @returns {Array<string>} 模型列表
|
|
*/
|
|
export function getProviderModels(providerType) {
|
|
return PROVIDER_MODELS[providerType] || [];
|
|
}
|
|
|
|
/**
|
|
* 获取所有提供商的模型列表
|
|
* @returns {Object} 所有提供商的模型映射
|
|
*/
|
|
export function getAllProviderModels() {
|
|
return PROVIDER_MODELS;
|
|
}
|