MCPcopy Create free account
hub / github.com/oboard/claude-code-rev / getConfiguredCustomModelOptions

Function getConfiguredCustomModelOptions

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

Source from the content-addressed store, hash-verified

44}
45
46function getConfiguredCustomModelOptions(): ModelOption[] {
47 const configuredModels = getConfiguredCustomModels() as unknown[] | undefined
48 if (!configuredModels?.length) {
49 return []
50 }
51
52 return configuredModels.flatMap(model => {
53 if (typeof model === 'string' && model.length > 0) {
54 return [{ value: model, label: model, description: 'Custom model' }]
55 }
56
57 if (!model || typeof model !== 'object') {
58 return []
59 }
60
61 const config = model as Record<string, unknown>
62 const value = config.model ?? config.value ?? config.id ?? config.name
63 if (typeof value !== 'string' || value.length === 0) {
64 return []
65 }
66
67 const label =
68 typeof config.label === 'string' && config.label.length > 0
69 ? config.label
70 : value
71 const description =
72 typeof config.description === 'string' && config.description.length > 0
73 ? config.description
74 : 'Custom model'
75
76 return [{ value, label, description }]
77 })
78}
79
80export function getDefaultOptionForUser(fastMode = false): ModelOption {
81 if (process.env.USER_TYPE === 'ant') {

Callers 3

getDefaultOptionForUserFunction · 0.85
getModelOptionsBaseFunction · 0.85
getModelOptionsFunction · 0.85

Calls 1

Tested by

no test coverage detected