* 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)
| 523 | * Returns null if the model is not recognized. |
| 524 | */ |
| 525 | function getKnownModelOption(model: string): ModelOption | null { |
| 526 | const marketingName = getMarketingNameForModel(model) |
| 527 | if (!marketingName) return null |
| 528 | |
| 529 | const familyInfo = getModelFamilyInfo(model) |
| 530 | if (!familyInfo) { |
| 531 | return { |
| 532 | value: model, |
| 533 | label: marketingName, |
| 534 | description: model, |
| 535 | } |
| 536 | } |
| 537 | |
| 538 | // Check if the alias currently resolves to a different (newer) version |
| 539 | if (marketingName !== familyInfo.currentVersionName) { |
| 540 | return { |
| 541 | value: model, |
| 542 | label: marketingName, |
| 543 | description: `Newer version available · select ${familyInfo.alias} for ${familyInfo.currentVersionName}`, |
| 544 | } |
| 545 | } |
| 546 | |
| 547 | // Same version as the alias — just show the friendly name |
| 548 | return { |
| 549 | value: model, |
| 550 | label: marketingName, |
| 551 | description: model, |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | export function getModelOptions(fastMode = false): ModelOption[] { |
| 556 | const options = getModelOptionsBase(fastMode) |
no test coverage detected