(modelId: string)
| 607 | |
| 608 | // @[MODEL LAUNCH]: Add a marketing name mapping for the new model below. |
| 609 | export function getMarketingNameForModel(modelId: string): string | undefined { |
| 610 | if (getAPIProvider() === 'foundry') { |
| 611 | // deployment ID is user-defined in Foundry, so it may have no relation to the actual model |
| 612 | return undefined |
| 613 | } |
| 614 | |
| 615 | const has1m = modelId.toLowerCase().includes('[1m]') |
| 616 | const canonical = getCanonicalName(modelId) |
| 617 | |
| 618 | if (canonical.includes('claude-opus-4-6')) { |
| 619 | return has1m ? 'Opus 4.6 (with 1M context)' : 'Opus 4.6' |
| 620 | } |
| 621 | if (canonical.includes('claude-opus-4-5')) { |
| 622 | return 'Opus 4.5' |
| 623 | } |
| 624 | if (canonical.includes('claude-opus-4-1')) { |
| 625 | return 'Opus 4.1' |
| 626 | } |
| 627 | if (canonical.includes('claude-opus-4')) { |
| 628 | return 'Opus 4' |
| 629 | } |
| 630 | if (canonical.includes('claude-sonnet-4-6')) { |
| 631 | return has1m ? 'Sonnet 4.6 (with 1M context)' : 'Sonnet 4.6' |
| 632 | } |
| 633 | if (canonical.includes('claude-sonnet-4-5')) { |
| 634 | return has1m ? 'Sonnet 4.5 (with 1M context)' : 'Sonnet 4.5' |
| 635 | } |
| 636 | if (canonical.includes('claude-sonnet-4')) { |
| 637 | return has1m ? 'Sonnet 4 (with 1M context)' : 'Sonnet 4' |
| 638 | } |
| 639 | if (canonical.includes('claude-3-7-sonnet')) { |
| 640 | return 'Claude 3.7 Sonnet' |
| 641 | } |
| 642 | if (canonical.includes('claude-3-5-sonnet')) { |
| 643 | return 'Claude 3.5 Sonnet' |
| 644 | } |
| 645 | if (canonical.includes('claude-haiku-4-5')) { |
| 646 | return 'Haiku 4.5' |
| 647 | } |
| 648 | if (canonical.includes('claude-3-5-haiku')) { |
| 649 | return 'Claude 3.5 Haiku' |
| 650 | } |
| 651 | // OpenAI Codex models |
| 652 | if (canonical.includes('gpt-5.4-mini')) { |
| 653 | return 'GPT-5.4 Mini' |
| 654 | } |
| 655 | if (canonical.includes('gpt-5.4')) { |
| 656 | return 'GPT-5.4' |
| 657 | } |
| 658 | if (canonical.includes('gpt-5.3-codex')) { |
| 659 | return 'GPT-5.3 Codex' |
| 660 | } |
| 661 | |
| 662 | return undefined |
| 663 | } |
| 664 | |
| 665 | export function normalizeModelStringForAPI(model: string): string { |
| 666 | return model.replace(/\[(1|2)m\]/gi, '') |
no test coverage detected