* 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)
| 468 | * Returns null if the model is not recognized. |
| 469 | */ |
| 470 | function getKnownModelOption(model: string): ModelOption | null { |
| 471 | const marketingName = getMarketingNameForModel(model) |
| 472 | if (!marketingName) return null |
| 473 | |
| 474 | const familyInfo = getModelFamilyInfo(model) |
| 475 | if (!familyInfo) { |
| 476 | return { |
| 477 | value: model, |
| 478 | label: marketingName, |
| 479 | description: model, |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | // Check if the alias currently resolves to a different (newer) version |
| 484 | if (marketingName !== familyInfo.currentVersionName) { |
| 485 | return { |
| 486 | value: model, |
| 487 | label: marketingName, |
| 488 | description: `Newer version available · select ${familyInfo.alias} for ${familyInfo.currentVersionName}`, |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | // Same version as the alias — just show the friendly name |
| 493 | return { |
| 494 | value: model, |
| 495 | label: marketingName, |
| 496 | description: model, |
| 497 | } |
| 498 | } |
| 499 | |
| 500 | export function getModelOptions(fastMode = false): ModelOption[] { |
| 501 | const options = getModelOptionsBase(fastMode) |
no test coverage detected