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

Function getCustomSonnetOption

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

Source from the content-addressed store, hash-verified

128}
129
130function getCustomSonnetOption(): ModelOption | undefined {
131 const is3P = getAPIProvider() !== 'firstParty'
132 const customSonnetModel = process.env.ANTHROPIC_DEFAULT_SONNET_MODEL
133 // When a 3P user has a custom sonnet model string, show it directly
134 if (is3P && customSonnetModel) {
135 const is1m = has1mContext(customSonnetModel)
136 return {
137 value: 'sonnet',
138 label:
139 process.env.ANTHROPIC_DEFAULT_SONNET_MODEL_NAME ?? customSonnetModel,
140 description:
141 process.env.ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION ??
142 `Custom balanced model${is1m ? ' (1M context)' : ''}`,
143 descriptionForModel: `${process.env.ANTHROPIC_DEFAULT_SONNET_MODEL_DESCRIPTION ?? `Custom balanced model${is1m ? ' with 1M context' : ''}`} (${customSonnetModel})`,
144 }
145 }
146}
147
148// @[MODEL LAUNCH]: Update or add model option functions (getSonnetXXOption, getOpusXXOption, etc.)
149// 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