(modelName)
| 62 | } |
| 63 | |
| 64 | export 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 | |
| 85 | export function normalizeApiMode(apiMode) { |
| 86 | if (!apiMode || typeof apiMode !== 'object') return null |
no test coverage detected