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