MCPcopy Index your code
hub / github.com/freecodexyz/free-code / getKnownModelOption

Function getKnownModelOption

src/utils/model/modelOptions.ts:470–498  ·  view source on GitHub ↗

* Returns a ModelOption for a known Anthropic model with a human-readable * label, and an upgrade hint if a newer version is available via the alias. * Returns null if the model is not recognized.

(model: string)

Source from the content-addressed store, hash-verified

468 * Returns null if the model is not recognized.
469 */
470function getKnownModelOption(model: string): ModelOption | null {
471 const marketingName = getMarketingNameForModel(model)
472 if (!marketingName) return null
473
474 const familyInfo = getModelFamilyInfo(model)
475 if (!familyInfo) {
476 return {
477 value: model,
478 label: marketingName,
479 description: model,
480 }
481 }
482
483 // Check if the alias currently resolves to a different (newer) version
484 if (marketingName !== familyInfo.currentVersionName) {
485 return {
486 value: model,
487 label: marketingName,
488 description: `Newer version available · select ${familyInfo.alias} for ${familyInfo.currentVersionName}`,
489 }
490 }
491
492 // Same version as the alias — just show the friendly name
493 return {
494 value: model,
495 label: marketingName,
496 description: model,
497 }
498}
499
500export function getModelOptions(fastMode = false): ModelOption[] {
501 const options = getModelOptionsBase(fastMode)

Callers 1

getModelOptionsFunction · 0.85

Calls 2

getMarketingNameForModelFunction · 0.85
getModelFamilyInfoFunction · 0.85

Tested by

no test coverage detected