* 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)
| 431 | * Returns null if the model is not recognized. |
| 432 | */ |
| 433 | function getKnownModelOption(model: string): ModelOption | null { |
| 434 | const marketingName = getMarketingNameForModel(model) |
| 435 | if (!marketingName) return null |
| 436 | |
| 437 | const familyInfo = getModelFamilyInfo(model) |
| 438 | if (!familyInfo) { |
| 439 | return { |
| 440 | value: model, |
| 441 | label: marketingName, |
| 442 | description: model, |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | // Check if the alias currently resolves to a different (newer) version |
| 447 | if (marketingName !== familyInfo.currentVersionName) { |
| 448 | return { |
| 449 | value: model, |
| 450 | label: marketingName, |
| 451 | description: `Newer version available · select ${familyInfo.alias} for ${familyInfo.currentVersionName}`, |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | // Same version as the alias — just show the friendly name |
| 456 | return { |
| 457 | value: model, |
| 458 | label: marketingName, |
| 459 | description: model, |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | export function getModelOptions(fastMode = false): ModelOption[] { |
| 464 | const options = getModelOptionsBase(fastMode) |
no test coverage detected