* Returns a ModelOption for a known Anthropic model with a human-readable * label, and an upgrade hint if a newer version is available via the alias. * Returns null if the model is not recognized.
(model: string)
| 506 | * Returns null if the model is not recognized. |
| 507 | */ |
| 508 | function getKnownModelOption(model: string): ModelOption | null { |
| 509 | const marketingName = getMarketingNameForModel(model) |
| 510 | if (!marketingName) return null |
| 511 | |
| 512 | const familyInfo = getModelFamilyInfo(model) |
| 513 | if (!familyInfo) { |
| 514 | return { |
| 515 | value: model, |
| 516 | label: marketingName, |
| 517 | description: model, |
| 518 | } |
| 519 | } |
| 520 | |
| 521 | // Check if the alias currently resolves to a different (newer) version |
| 522 | if (marketingName !== familyInfo.currentVersionName) { |
| 523 | return { |
| 524 | value: model, |
| 525 | label: marketingName, |
| 526 | description: `Newer version available · select ${familyInfo.alias} for ${familyInfo.currentVersionName}`, |
| 527 | } |
| 528 | } |
| 529 | |
| 530 | // Same version as the alias — just show the friendly name |
| 531 | return { |
| 532 | value: model, |
| 533 | label: marketingName, |
| 534 | description: model, |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | export function getModelOptions(fastMode = false): ModelOption[] { |
| 539 | const options = getModelOptionsBase(fastMode) |
no test coverage detected