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

Function get3PFallbackSuggestion

src/utils/model/validateModel.ts:152–167  ·  view source on GitHub ↗

* Suggest a fallback model for 3P users when the selected model is unavailable.

(model: string)

Source from the content-addressed store, hash-verified

150 * Suggest a fallback model for 3P users when the selected model is unavailable.
151 */
152function get3PFallbackSuggestion(model: string): string | undefined {
153 if (getAPIProvider() === 'firstParty') {
154 return undefined
155 }
156 const lowerModel = model.toLowerCase()
157 if (lowerModel.includes('opus-4-6') || lowerModel.includes('opus_4_6')) {
158 return getModelStrings().opus41
159 }
160 if (lowerModel.includes('sonnet-4-6') || lowerModel.includes('sonnet_4_6')) {
161 return getModelStrings().sonnet45
162 }
163 if (lowerModel.includes('sonnet-4-5') || lowerModel.includes('sonnet_4_5')) {
164 return getModelStrings().sonnet40
165 }
166 return undefined
167}

Callers 1

handleValidationErrorFunction · 0.85

Calls 2

getAPIProviderFunction · 0.85
getModelStringsFunction · 0.70

Tested by

no test coverage detected