|
@@ -1451,6 +1451,18 @@ describe('LocalModelResolver custom provider compat overrides', () => {
|
|
|
'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
|
'https://dashscope.aliyuncs.com/compatible-mode/v1',
|
|
|
'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
|
|
'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
|
|
|
'https://dashscope-us.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',
|
|
|
])('keeps the system role for a thinking model at %s', async (baseURL) => {
|
|
])('keeps the system role for a thinking model at %s', async (baseURL) => {
|
|
|
expect(await systemPromptRoleFor(undefined, baseURL)).toBe('system');
|
|
expect(await systemPromptRoleFor(undefined, baseURL)).toBe('system');
|
|
|
});
|
|
});
|
|
@@ -1461,12 +1473,20 @@ describe('LocalModelResolver custom provider compat overrides', () => {
|
|
|
['https://api.moonshot.ai/v1', 'system'],
|
|
['https://api.moonshot.ai/v1', 'system'],
|
|
|
['https://dashscope.aliyuncs.com.example/v1', 'developer'],
|
|
['https://dashscope.aliyuncs.com.example/v1', 'developer'],
|
|
|
['https://gateway.example/dashscope.aliyuncs.com/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'],
|
|
|
])('preserves the system prompt role for %s', async (baseURL, role) => {
|
|
])('preserves the system prompt role for %s', async (baseURL, role) => {
|
|
|
expect(await systemPromptRoleFor(undefined, baseURL)).toBe(role);
|
|
expect(await systemPromptRoleFor(undefined, baseURL)).toBe(role);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
it.each([
|
|
it.each([
|
|
|
'https://dashscope.aliyuncs.com/compatible-mode/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) => {
|
|
])('honors an explicit developer-role override on %s', async (baseURL) => {
|
|
|
expect(
|
|
expect(
|
|
|
await systemPromptRoleFor(
|
|
await systemPromptRoleFor(
|