|
|
@@ -1450,6 +1450,23 @@ describe('LocalModelResolver custom provider compat overrides', () => {
|
|
|
it.each([
|
|
|
'https://api.siliconflow.cn/v1',
|
|
|
'https://api.siliconflow.com/v1',
|
|
|
+ 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://dashscope-us.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://cn-hongkong.dashscope.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://coding.dashscope.aliyuncs.com/v1',
|
|
|
+ 'https://coding-intl.dashscope.aliyuncs.com/v1',
|
|
|
+ 'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://trial.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.cn-hongkong.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.ap-northeast-1.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.eu-central-1.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.us-east-1.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://api.kimi.com/coding/v1',
|
|
|
+ 'https://api.kimi.ai/coding/v1',
|
|
|
])('keeps the system role for a thinking model at %s', async (baseURL) => {
|
|
|
expect(await systemPromptRoleFor(undefined, baseURL)).toBe('system');
|
|
|
});
|
|
|
@@ -1461,6 +1478,17 @@ describe('LocalModelResolver custom provider compat overrides', () => {
|
|
|
['https://gateway.example/api.siliconflow.cn/v1', 'developer'],
|
|
|
['https://api.siliconflow.com.example/v1', 'developer'],
|
|
|
['https://gateway.example/api.siliconflow.com/v1', 'developer'],
|
|
|
+ ['https://api.moonshot.cn/v1', 'system'],
|
|
|
+ ['https://api.moonshot.ai/v1', 'system'],
|
|
|
+ ['https://dashscope.aliyuncs.com.example/v1', 'developer'],
|
|
|
+ ['https://gateway.example/dashscope.aliyuncs.com/v1', 'developer'],
|
|
|
+ ['https://coding.dashscope.aliyuncs.com.example/v1', 'developer'],
|
|
|
+ ['https://token-plan.cn-beijing.maas.aliyuncs.com.example/v1', 'developer'],
|
|
|
+ ['https://gateway.example/token-plan.cn-beijing.maas.aliyuncs.com/v1', 'developer'],
|
|
|
+ ['https://example-workspace.unknown-region.maas.aliyuncs.com/v1', 'developer'],
|
|
|
+ ['https://example-workspace.cn-beijing.aliyuncs.com/v1', 'developer'],
|
|
|
+ ['https://api.kimi.com.example/v1', 'developer'],
|
|
|
+ ['https://gateway.example/api.kimi.com/coding/v1', 'developer'],
|
|
|
])('preserves the system prompt role for %s', async (baseURL, role) => {
|
|
|
expect(await systemPromptRoleFor(undefined, baseURL)).toBe(role);
|
|
|
});
|
|
|
@@ -1468,6 +1496,10 @@ describe('LocalModelResolver custom provider compat overrides', () => {
|
|
|
it.each([
|
|
|
'https://api.siliconflow.cn/v1',
|
|
|
'https://api.siliconflow.com/v1',
|
|
|
+ 'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://coding.dashscope.aliyuncs.com/v1',
|
|
|
+ 'https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
+ 'https://example-workspace.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1',
|
|
|
])('honors an explicit developer-role override on %s', async (baseURL) => {
|
|
|
expect(
|
|
|
await systemPromptRoleFor(
|
|
|
@@ -1476,4 +1508,13 @@ describe('LocalModelResolver custom provider compat overrides', () => {
|
|
|
),
|
|
|
).toBe('developer');
|
|
|
});
|
|
|
+
|
|
|
+ it('honors an explicit developer-role override on a Kimi Coding endpoint', async () => {
|
|
|
+ expect(
|
|
|
+ await systemPromptRoleFor(
|
|
|
+ { supportsDeveloperRole: true },
|
|
|
+ 'https://api.kimi.com/coding/v1',
|
|
|
+ ),
|
|
|
+ ).toBe('developer');
|
|
|
+ });
|
|
|
});
|