(modelId: string)
| 703 | |
| 704 | // @[MODEL LAUNCH]: Add a marketing name mapping for the new model below. |
| 705 | export function getMarketingNameForModel(modelId: string): string | undefined { |
| 706 | const ncodeModel = resolveNCodeManagedModel(modelId) |
| 707 | if (ncodeModel) { |
| 708 | return ncodeModel.label |
| 709 | } |
| 710 | |
| 711 | if (getAPIProvider() === 'foundry') { |
| 712 | // deployment ID is user-defined in Foundry, so it may have no relation to the actual model |
| 713 | return undefined |
| 714 | } |
| 715 | |
| 716 | const has1m = modelId.toLowerCase().includes('[1m]') |
| 717 | const canonical = getCanonicalName(modelId) |
| 718 | |
| 719 | if (canonical.includes('claude-opus-4-6')) { |
| 720 | return has1m ? 'Opus 4.6 (with 1M context)' : 'Opus 4.6' |
| 721 | } |
| 722 | if (canonical.includes('claude-opus-4-5')) { |
| 723 | return 'Opus 4.5' |
| 724 | } |
| 725 | if (canonical.includes('claude-opus-4-1')) { |
| 726 | return 'Opus 4.1' |
| 727 | } |
| 728 | if (canonical.includes('claude-opus-4')) { |
| 729 | return 'Opus 4' |
| 730 | } |
| 731 | if (canonical.includes('claude-sonnet-4-6')) { |
| 732 | return has1m ? 'Sonnet 4.6 (with 1M context)' : 'Sonnet 4.6' |
| 733 | } |
| 734 | if (canonical.includes('claude-sonnet-4-5')) { |
| 735 | return has1m ? 'Sonnet 4.5 (with 1M context)' : 'Sonnet 4.5' |
| 736 | } |
| 737 | if (canonical.includes('claude-sonnet-4')) { |
| 738 | return has1m ? 'Sonnet 4 (with 1M context)' : 'Sonnet 4' |
| 739 | } |
| 740 | if (canonical.includes('claude-3-7-sonnet')) { |
| 741 | return 'Claude 3.7 Sonnet' |
| 742 | } |
| 743 | if (canonical.includes('claude-3-5-sonnet')) { |
| 744 | return 'Claude 3.5 Sonnet' |
| 745 | } |
| 746 | if (canonical.includes('claude-haiku-4-5')) { |
| 747 | return 'Haiku 4.5' |
| 748 | } |
| 749 | if (canonical.includes('claude-3-5-haiku')) { |
| 750 | return 'Claude 3.5 Haiku' |
| 751 | } |
| 752 | |
| 753 | return undefined |
| 754 | } |
| 755 | |
| 756 | export function normalizeModelStringForAPI(model: string): string { |
| 757 | return model.replace(/\[(1|2)m\]/gi, '') |
no test coverage detected