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

Function apiModeToModelName

src/utils/model-name-convert.mjs:100–112  ·  view source on GitHub ↗
(apiMode)

Source from the content-addressed store, hash-verified

98}
99
100export function apiModeToModelName(apiMode) {
101 apiMode = normalizeApiMode(apiMode)
102 if (!apiMode) return ''
103 if (AlwaysCustomGroups.includes(apiMode.groupName))
104 return apiMode.groupName + '-' + apiMode.customName
105
106 if (apiMode.isCustom) {
107 if (apiMode.itemName === 'custom') return apiMode.groupName + '-' + apiMode.customName
108 return apiMode.itemName + '-' + apiMode.customName
109 }
110
111 return apiMode.itemName
112}
113
114function resolveCanonicalActiveApiModeInfo(modelName, config) {
115 let normalizedModelName = modelName

Callers 13

ConversationCardFunction · 0.90
cropTextFunction · 0.90
initSessionFunction · 0.90
onMessageFunction · 0.90
getApiModeDisplayLabelFunction · 0.90
getModelValueFunction · 0.85
getApiModesFromConfigFunction · 0.85
matchesModelNameFunction · 0.85
isUsingModelNameFunction · 0.85

Calls 1

normalizeApiModeFunction · 0.85

Tested by

no test coverage detected