diff --git a/src/components/AddWorker/index.tsx b/src/components/AddWorker/index.tsx index 64fc05f49..694a72e4d 100644 --- a/src/components/AddWorker/index.tsx +++ b/src/components/AddWorker/index.tsx @@ -109,6 +109,40 @@ export function AddWorker({ const [useCustomModel, setUseCustomModel] = useState(false); const [customModelPlatform, setCustomModelPlatform] = useState(''); const [customModelType, setCustomModelType] = useState(''); + const [isCustomModelTypeCustom, setIsCustomModelTypeCustom] = useState(false); + + const modelTypeOptionsByPlatform: Record = { + openai: ['gpt-5.5', 'gpt-5.4', 'gpt-5-mini', 'gpt-4o-mini'], + azure: ['gpt-5.5', 'gpt-5.4', 'gpt-5-mini', 'gpt-4o-mini'], + 'openai-compatible-model': ['gpt-4o-mini', 'gpt-5-mini', 'gpt-5.5'], + anthropic: [ + 'claude-sonnet-4-6', + 'claude-sonnet-4-5', + 'claude-opus-4-7', + 'claude-opus-4-6', + 'claude-haiku-4-5', + ], + gemini: [ + 'gemini-3.1-pro-preview', + 'gemini-3-pro-preview', + 'gemini-3-flash-preview', + ], + deepseek: ['deepseek-v4-pro'], + minimax: ['minimax_m2_7'], + }; + + const getModelTypeOptions = (platform: string): string[] => { + const platformOptions = modelTypeOptionsByPlatform[platform]; + if (platformOptions && platformOptions.length > 0) return platformOptions; + // Fallback list for unknown/custom platforms + return [ + 'gpt-4o-mini', + 'gpt-5-mini', + 'gpt-5.5', + 'claude-sonnet-4-6', + 'gemini-3.1-pro-preview', + ]; + }; if (!chatStore) { return null; @@ -269,6 +303,7 @@ export function AddWorker({ setUseCustomModel(false); setCustomModelPlatform(''); setCustomModelType(''); + setIsCustomModelTypeCustom(false); }; // tool function @@ -642,7 +677,11 @@ export function AddWorker({ - setCustomModelType(e.target.value) + + + {isCustomModelTypeCustom && ( + + setCustomModelType(e.target.value) + } + /> + )} )}