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