capabilitiesFor function
Resolve capabilities for the given (provider, model) pair.
Switches on providerId:
'anthropic'— vision-tier caps iff kAnthropicVisionModels containsmodelId; otherwisenull(unknown).'openai'— looks up openAiModels; returns the entry's capabilities, ornullif absent.'swift-infer'— qwen-tier caps iffmodelIdstarts with'qwen3'; otherwisenull.- anything else —
null.
Implementation
ModelCapabilities? capabilitiesFor(String providerId, String modelId) {
switch (providerId) {
case 'anthropic':
return kAnthropicVisionModels.contains(modelId)
? _anthropicVisionCaps
: null;
case 'openai':
return openAiModels[modelId]?.capabilities;
case 'swift-infer':
return modelId.startsWith('qwen3') ? _swiftInferQwenCaps : null;
default:
return null;
}
}