feat: use managed model capabilities for reasoning and image input
This commit is contained in:
1 parent
e7701d1f2c
commit
26cbb29aa9
29 files changed
+652
-271
No files matched your search
@@ -120,6 +120,21 @@ describe('provider host api routes', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('preserves exact v2 public aliases and native effort values on import', () => {
|
||||
const config = normalizeImportedUserModelConfig({
|
||||
base_url: 'https://gateway.test/v1', api_key: 'test', models: ['deepseek/public-model'],
|
||||
model_capabilities_v2: { schema_version: 2, models: {
|
||||
'deepseek/public-model': { input_modalities: ['text', 'image'],
|
||||
reasoning: { supported: true, can_disable: true, effort_values: ['medium', 'xhigh', 'new-native'], control_format: 'qwen' } },
|
||||
'not-authorized': { input_modalities: ['image'] },
|
||||
} },
|
||||
});
|
||||
expect(config.models).toEqual(['deepseek/public-model']);
|
||||
expect(Object.keys(config.modelCapabilitiesV2!.models)).toEqual(['deepseek/public-model']);
|
||||
expect(config.modelCapabilitiesV2!.models['deepseek/public-model']!.reasoning.effortValues)
|
||||
.toEqual(['medium', 'xhigh', 'new-native']);
|
||||
});
|
||||
|
||||
it('persists server capabilities and invalidates the runtime when they change', async () => {
|
||||
const existing = account({
|
||||
id: 'niancode-user-models',
|
||||
@@ -152,9 +167,13 @@ describe('provider host api routes', () => {
|
||||
reasoning_can_disable: true,
|
||||
},
|
||||
},
|
||||
model_capabilities_v2: { schema_version: 2, models: { 'deepseek/deepseek-v4-pro': {
|
||||
input_modalities: ['text'], reasoning: { supported: true, can_disable: true, effort_values: ['xhigh'] },
|
||||
} } },
|
||||
}), { status: 200, headers: { 'content-type': 'application/json' } }));
|
||||
|
||||
const imported = await importCurrentUserModelConfig(context, 'access-token');
|
||||
expect(imported.account.metadata?.worksSquareModelCapabilitiesV2?.models['deepseek/deepseek-v4-pro']?.reasoning.effortValues).toEqual(['xhigh']);
|
||||
|
||||
expect(imported.account.metadata?.worksSquareModelCapabilities).toEqual({
|
||||
'deepseek-v4-pro': {
|
||||
|
||||
Reference in new issue
Block a user