(modelId: string)
| 568 | |
| 569 | // @[MODEL LAUNCH]: Add a marketing name mapping for the new model below. |
| 570 | export function getMarketingNameForModel(modelId: string): string | undefined { |
| 571 | if (getAPIProvider() === 'foundry') { |
| 572 | // deployment ID is user-defined in Foundry, so it may have no relation to the actual model |
| 573 | return undefined |
| 574 | } |
| 575 | |
| 576 | const has1m = modelId.toLowerCase().includes('[1m]') |
| 577 | const canonical = getCanonicalName(modelId) |
| 578 | |
| 579 | if (canonical.includes('claude-opus-4-6')) { |
| 580 | return has1m ? 'Opus 4.6 (with 1M context)' : 'Opus 4.6' |
| 581 | } |
| 582 | if (canonical.includes('claude-opus-4-5')) { |
| 583 | return 'Opus 4.5' |
| 584 | } |
| 585 | if (canonical.includes('claude-opus-4-1')) { |
| 586 | return 'Opus 4.1' |
| 587 | } |
| 588 | if (canonical.includes('claude-opus-4')) { |
| 589 | return 'Opus 4' |
| 590 | } |
| 591 | if (canonical.includes('claude-sonnet-4-6')) { |
| 592 | return has1m ? 'Sonnet 4.6 (with 1M context)' : 'Sonnet 4.6' |
| 593 | } |
| 594 | if (canonical.includes('claude-sonnet-4-5')) { |
| 595 | return has1m ? 'Sonnet 4.5 (with 1M context)' : 'Sonnet 4.5' |
| 596 | } |
| 597 | if (canonical.includes('claude-sonnet-4')) { |
| 598 | return has1m ? 'Sonnet 4 (with 1M context)' : 'Sonnet 4' |
| 599 | } |
| 600 | if (canonical.includes('claude-3-7-sonnet')) { |
| 601 | return 'Claude 3.7 Sonnet' |
| 602 | } |
| 603 | if (canonical.includes('claude-3-5-sonnet')) { |
| 604 | return 'Claude 3.5 Sonnet' |
| 605 | } |
| 606 | if (canonical.includes('claude-haiku-4-5')) { |
| 607 | return 'Haiku 4.5' |
| 608 | } |
| 609 | if (canonical.includes('claude-3-5-haiku')) { |
| 610 | return 'Claude 3.5 Haiku' |
| 611 | } |
| 612 | |
| 613 | return undefined |
| 614 | } |
| 615 | |
| 616 | export function normalizeModelStringForAPI(model: string): string { |
| 617 | return model.replace(/\[(1|2)m\]/gi, '') |
no test coverage detected