MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getCustomSonnetOption

Function getCustomSonnetOption

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

Source from the content-addressed store, hash-verified

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