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

Function getUserSpecifiedModelSetting

src/utils/model/model.ts:64–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 * 4. Settings (from user's saved settings)
63 */
64export function getUserSpecifiedModelSetting(): ModelSetting | undefined {
65 let specifiedModel: ModelSetting | undefined
66
67 const modelOverride = getMainLoopModelOverride()
68 if (modelOverride !== undefined) {
69 specifiedModel = modelOverride
70 } else {
71 const settings = getSettings_DEPRECATED() || {}
72 specifiedModel = process.env.ANTHROPIC_MODEL || settings.model || undefined
73 }
74
75 // Ignore the user-specified model if it's not in the availableModels allowlist.
76 if (specifiedModel && !isModelAllowed(specifiedModel)) {
77 return undefined
78 }
79
80 return specifiedModel
81}
82
83/**
84 * Get the main loop model to use for the current session.

Callers 6

runFunction · 0.85
getAvailableUpgradeFunction · 0.85
getModelOptionsFunction · 0.85
getMainLoopModelFunction · 0.85
getRuntimeMainLoopModelFunction · 0.85
isRelevantFunction · 0.85

Calls 2

getMainLoopModelOverrideFunction · 0.85
isModelAllowedFunction · 0.85

Tested by

no test coverage detected