(modelId: string)
| 590 | |
| 591 | // @[MODEL LAUNCH]: Add a marketing name mapping for the new model below. |
| 592 | export function getMarketingNameForModel(modelId: string): string | undefined { |
| 593 | if (getAPIProvider() === 'foundry') { |
| 594 | // deployment ID is user-defined in Foundry, so it may have no relation to the actual model |
| 595 | return undefined |
| 596 | } |
| 597 | |
| 598 | const has1m = modelId.toLowerCase().includes('[1m]') |
| 599 | const canonical = getCanonicalName(modelId) |
| 600 | |
| 601 | if (canonical.includes('claude-opus-4-6')) { |
| 602 | return has1m ? 'Opus 4.6 (with 1M context)' : 'Opus 4.6' |
| 603 | } |
| 604 | if (canonical.includes('claude-opus-4-5')) { |
| 605 | return 'Opus 4.5' |
| 606 | } |
| 607 | if (canonical.includes('claude-opus-4-1')) { |
| 608 | return 'Opus 4.1' |
| 609 | } |
| 610 | if (canonical.includes('claude-opus-4')) { |
| 611 | return 'Opus 4' |
| 612 | } |
| 613 | if (canonical.includes('claude-sonnet-4-6')) { |
| 614 | return has1m ? 'Sonnet 4.6 (with 1M context)' : 'Sonnet 4.6' |
| 615 | } |
| 616 | if (canonical.includes('claude-sonnet-4-5')) { |
| 617 | return has1m ? 'Sonnet 4.5 (with 1M context)' : 'Sonnet 4.5' |
| 618 | } |
| 619 | if (canonical.includes('claude-sonnet-4')) { |
| 620 | return has1m ? 'Sonnet 4 (with 1M context)' : 'Sonnet 4' |
| 621 | } |
| 622 | if (canonical.includes('claude-3-7-sonnet')) { |
| 623 | return 'Claude 3.7 Sonnet' |
| 624 | } |
| 625 | if (canonical.includes('claude-3-5-sonnet')) { |
| 626 | return 'Claude 3.5 Sonnet' |
| 627 | } |
| 628 | if (canonical.includes('claude-haiku-4-5')) { |
| 629 | return 'Haiku 4.5' |
| 630 | } |
| 631 | if (canonical.includes('claude-3-5-haiku')) { |
| 632 | return 'Claude 3.5 Haiku' |
| 633 | } |
| 634 | |
| 635 | return undefined |
| 636 | } |
| 637 | |
| 638 | export function normalizeModelStringForAPI(model: string): string { |
| 639 | return model.replace(/\[(1|2)m\]/gi, '') |
no test coverage detected