| 391 | } |
| 392 | |
| 393 | function buildBestForLine(model: { |
| 394 | pricing: PricingInfo |
| 395 | capabilities: ModelCapabilities |
| 396 | contextWindow: number | null |
| 397 | }): string | null { |
| 398 | const { pricing, capabilities, contextWindow } = model |
| 399 | |
| 400 | if (capabilities.deepResearch) { |
| 401 | return 'Best for multi-step research workflows and agent-led web investigation.' |
| 402 | } |
| 403 | |
| 404 | if (capabilities.reasoningEffort || capabilities.thinking) { |
| 405 | return 'Best for reasoning-heavy tasks that need more deliberate model control.' |
| 406 | } |
| 407 | |
| 408 | if (contextWindow && contextWindow >= 1000000) { |
| 409 | return 'Best for long-context retrieval, large documents, and high-memory workflows.' |
| 410 | } |
| 411 | |
| 412 | if (capabilities.nativeStructuredOutputs) { |
| 413 | return 'Best for production workflows that need reliable typed outputs.' |
| 414 | } |
| 415 | |
| 416 | if (pricing.input <= 0.2 && pricing.output <= 1.25) { |
| 417 | return 'Best for cost-sensitive automations, background tasks, and high-volume workloads.' |
| 418 | } |
| 419 | |
| 420 | return null |
| 421 | } |
| 422 | |
| 423 | function buildModelSummary( |
| 424 | providerName: string, |