capabilitiesFor function

ModelCapabilities? capabilitiesFor(
  1. String providerId,
  2. String modelId
)

Resolve capabilities for the given (provider, model) pair.

Switches on providerId:

  • 'anthropic' — vision-tier caps iff kAnthropicVisionModels contains modelId; otherwise null (unknown).
  • 'openai' — looks up openAiModels; returns the entry's capabilities, or null if absent.
  • 'swift-infer' — qwen-tier caps iff modelId starts with 'qwen3'; otherwise null.
  • 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;
  }
}