MCPcopy
hub / github.com/codeaashu/claude-code / getCustomSonnetOption

Function getCustomSonnetOption

src/utils/model/modelOptions.ts:76–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76function getCustomSonnetOption(): ModelOption | undefined {
77 const is3P = getAPIProvider() !== 'firstParty'
78 const customSonnetModel = process.env.ANTHROPIC_DEFAULT_SONNET_MODEL
79 // When a 3P user has a custom sonnet model string, show it directly
80 if (is3P && customSonnetModel) {
81 const is1m = has1mContext(customSonnetModel)
82 return {
83 value: 'sonnet',
84 label:
85 process.env.ANTHROPIC_DEFAULT_SONNET_MODEL_NAME ?? customSonnetModel,
86 description:
87 process.env.ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION ??
88 `Custom Sonnet model${is1m ? ' (1M context)' : ''}`,
89 descriptionForModel: `${process.env.ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION ?? `Custom Sonnet model${is1m ? ' with 1M context' : ''}`} (${customSonnetModel})`,
90 }
91 }
92}
93
94// @[MODEL LAUNCH]: Update or add model option functions (getSonnetXXOption, getOpusXXOption, etc.)
95// with the new model's label and description. These appear in the /model picker.

Callers 1

getModelOptionsBaseFunction · 0.85

Calls 2

getAPIProviderFunction · 0.85
has1mContextFunction · 0.85

Tested by

no test coverage detected