forked from iflytek/astron-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel-provider-orcarouter.test.js
More file actions
44 lines (40 loc) · 1.6 KB
/
Copy pathmodel-provider-orcarouter.test.js
File metadata and controls
44 lines (40 loc) · 1.6 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
import assert from 'node:assert/strict';
import test from 'node:test';
import {
mapProviderToVendor,
getSpecificProviderOptions,
} from '../src/pages/model-management/utils/provider-group.ts';
import { ModelProviderType } from '../src/types/model.ts';
// OrcaRouter is registered as a named provider in the Official Providers catalog.
test('ModelProviderType includes ORCAROUTER', () => {
assert.ok('ORCAROUTER' in ModelProviderType);
assert.equal(ModelProviderType.ORCAROUTER, 'orcarouter');
});
// OrcaRouter exposes an OpenAI-compatible chat completions endpoint, so it must
// map to the OpenAI vendor group (openai-compatible).
test('orcarouter maps to the OpenAI-compatible vendor', () => {
assert.equal(
mapProviderToVendor(ModelProviderType.ORCAROUTER),
ModelProviderType.OPENAI
);
});
// It must appear as a selectable provider option on the Official Providers page.
test('getSpecificProviderOptions includes the OrcaRouter option', () => {
const specificOptions = getSpecificProviderOptions();
const orcaOption = specificOptions.find(
option => option.value === ModelProviderType.ORCAROUTER
);
assert.ok(orcaOption, 'getSpecificProviderOptions should include OrcaRouter');
assert.equal(orcaOption.label, 'OrcaRouter');
});
// Other OpenAI-compatible providers must keep mapping to the OpenAI vendor.
test('existing OpenAI-compatible providers still map to the OpenAI vendor', () => {
assert.equal(
mapProviderToVendor(ModelProviderType.DEEPSEEK),
ModelProviderType.OPENAI
);
assert.equal(
mapProviderToVendor(ModelProviderType.MINIMAX),
ModelProviderType.OPENAI
);
});