MCPcopy Create free account
hub / github.com/ChatGPTBox-dev/chatGPTBox / modelNameToApiMode

Function modelNameToApiMode

src/utils/model-name-convert.mjs:64–83  ·  view source on GitHub ↗
(modelName)

Source from the content-addressed store, hash-verified

62}
63
64export function modelNameToApiMode(modelName) {
65 const presetPart = modelNameToPresetPart(modelName)
66 const found = getModelNameGroup(presetPart)
67 if (found) {
68 const [groupName] = found
69 const isCustom = isCustomModelName(modelName)
70 let customName = ''
71 if (isCustom) customName = modelNameToCustomPart(modelName)
72 return {
73 groupName,
74 itemName: presetPart,
75 isCustom,
76 customName,
77 customUrl: '',
78 apiKey: '',
79 providerId: '',
80 active: true,
81 }
82 }
83}
84
85export function normalizeApiMode(apiMode) {
86 if (!apiMode || typeof apiMode !== 'object') return null

Calls 4

modelNameToPresetPartFunction · 0.85
getModelNameGroupFunction · 0.85
isCustomModelNameFunction · 0.85
modelNameToCustomPartFunction · 0.85

Tested by

no test coverage detected