-
Notifications
You must be signed in to change notification settings - Fork 854
Expand file tree
/
Copy pathminimax-api.test.mjs
More file actions
59 lines (54 loc) · 2 KB
/
minimax-api.test.mjs
File metadata and controls
59 lines (54 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import assert from 'node:assert/strict'
import { describe, test } from 'node:test'
import {
miniMaxApiModelKeys,
isUsingMiniMaxApiModel,
Models,
ModelGroups,
} from '../../src/config/index.mjs'
describe('MiniMax integration', () => {
test('all MiniMax model keys have corresponding Models entries', () => {
for (const key of miniMaxApiModelKeys) {
assert.ok(Models[key], `Models entry missing for ${key}`)
assert.ok(Models[key].value, `Models[${key}].value is empty`)
assert.ok(Models[key].desc, `Models[${key}].desc is empty`)
}
})
test('MiniMax model group is registered in ModelGroups', () => {
assert.ok(ModelGroups.miniMaxApiModelKeys, 'MiniMax group missing from ModelGroups')
assert.equal(ModelGroups.miniMaxApiModelKeys.desc, 'MiniMax (API)')
assert.deepEqual(ModelGroups.miniMaxApiModelKeys.value, miniMaxApiModelKeys)
})
test('MiniMax model values match expected API model names', () => {
assert.equal(Models.minimax_m27.value, 'MiniMax-M2.7')
assert.equal(Models.minimax_m25.value, 'MiniMax-M2.5')
assert.equal(Models.minimax_m25_highspeed.value, 'MiniMax-M2.5-highspeed')
})
test('isUsingMiniMaxApiModel does not match other provider models', () => {
const otherModels = [
'chatgptApi4oMini',
'deepseek_chat',
'moonshot_v1_8k',
'claude37SonnetApi',
'customModel',
'ollamaModel',
]
for (const modelName of otherModels) {
assert.equal(isUsingMiniMaxApiModel({ modelName }), false, `Should not match ${modelName}`)
}
})
test('MiniMax model keys are unique and do not overlap with other groups', () => {
const allOtherKeys = []
for (const [groupName, group] of Object.entries(ModelGroups)) {
if (groupName === 'miniMaxApiModelKeys') continue
allOtherKeys.push(...group.value)
}
for (const key of miniMaxApiModelKeys) {
assert.equal(
allOtherKeys.includes(key),
false,
`MiniMax key ${key} overlaps with another group`,
)
}
})
})