feat: consume server model reasoning capabilities
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
estimateImportedModelVisionTokens,
|
||||
getImportedModelProfile,
|
||||
} from '../../shared/imported-model-profile';
|
||||
import { normalizeImportedModelCapabilities } from '../../shared/user-model-config';
|
||||
import {
|
||||
getKnownModelCapabilityKind,
|
||||
getModelCapabilityLabel,
|
||||
@@ -10,6 +11,74 @@ import {
|
||||
} from '../../shared/model-capabilities';
|
||||
|
||||
describe('getImportedModelProfile', () => {
|
||||
it('returns native DeepSeek V4 Pro thinking levels without generic placeholders', () => {
|
||||
expect(getImportedModelProfile('deepseek-v4-pro')).toMatchObject({
|
||||
modalities: {
|
||||
input: ['text'],
|
||||
output: ['text'],
|
||||
},
|
||||
limit: {
|
||||
context: 1_000_000,
|
||||
output: 384_000,
|
||||
},
|
||||
pi: {
|
||||
reasoning: true,
|
||||
thinkingLevelMap: {
|
||||
minimal: null,
|
||||
low: 'low',
|
||||
medium: null,
|
||||
high: 'high',
|
||||
max: 'max',
|
||||
},
|
||||
compat: {
|
||||
thinkingFormat: 'deepseek',
|
||||
supportsReasoningEffort: true,
|
||||
requiresReasoningContentOnAssistantMessages: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('normalizes Works model capabilities by normalized model id and supported effort', () => {
|
||||
expect(normalizeImportedModelCapabilities({
|
||||
'deepseek/deepseek-v4-pro': {
|
||||
reasoning_efforts: ['max', 'low', 'low', 'medium', 'unsupported'],
|
||||
reasoning_can_disable: true,
|
||||
},
|
||||
'qwen3.8-max': {
|
||||
reasoning_efforts: ['high'],
|
||||
reasoning_can_disable: false,
|
||||
},
|
||||
'unknown-model': {
|
||||
reasoning_efforts: ['low'],
|
||||
reasoning_can_disable: 'yes',
|
||||
},
|
||||
}, ['deepseek-v4-pro', 'qwen3.8-max'])).toEqual({
|
||||
'deepseek-v4-pro': {
|
||||
reasoningEfforts: ['low', 'max'],
|
||||
reasoningCanDisable: true,
|
||||
},
|
||||
'qwen3.8-max': {
|
||||
reasoningEfforts: ['high'],
|
||||
reasoningCanDisable: false,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('preserves an explicit empty effort list so the server can disable local reasoning metadata', () => {
|
||||
expect(normalizeImportedModelCapabilities({
|
||||
'deepseek-v4-pro': {
|
||||
reasoning_efforts: [],
|
||||
reasoning_can_disable: false,
|
||||
},
|
||||
}, ['deepseek-v4-pro'])).toEqual({
|
||||
'deepseek-v4-pro': {
|
||||
reasoningEfforts: [],
|
||||
reasoningCanDisable: false,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
'qwen3.6-plus',
|
||||
'qwen3.6-plus-2026-04-02',
|
||||
|
||||
Reference in New Issue
Block a user