Reasoning strategies: explicit wire format and natural levels
Support generates reasoning parameters from an explicitly chosen protocol format, preserving exact overrides and custom mappings.
CompatibleModelProvider's config.reasoning uses level=off/low/medium/high and explicitly selects format. reasoning-effort generates reasoning_effort; thinking and enable-thinking only express an on/off switch and do not claim that low/high differ in strength; thinking-budget defaults the thinking budget for low/medium/high to 1024/4096/8192 and can be overridden through budgets; custom uses a synchronous map(level).
Explicit fields in requestBody take priority. Neither a mapper nor requestBody can override the model, messages, stream, or Core output limits. The thinking budget must be smaller than the actual output token limit; do not resolve the conflict by raising the Core quota. The format is determined by the provider declaration and must not be used merely because model names look similar; an independent Provider can still implement the same ChatProvider contract.
Progressive examples for the same business case
Generate a thinking budget for an explicit wire format
Configuration · Node.js
This only assembles configuration and sends no network request. At call time the output token limit must be larger than the thinking budget.
import { Support } from '@jangts/agent-core';
const provider = new Support.CompatibleModelProvider({ config: {
baseUrl: 'https://provider.example', apiKey: 'placeholder', model: 'configured-model',
reasoning: { format: 'thinking-budget', level: 'high', budgets: { high: 6000 } },
} });
console.log(provider instanceof Support.CompatibleModelProvider);import { Support } from '@jangts/agent-core';
const provider = new Support.CompatibleModelProvider({ config: {
baseUrl: 'https://provider.example', apiKey: 'placeholder', model: 'configured-model',
reasoning: { format: 'thinking-budget', level: 'high', budgets: { high: 6000 } },
} });
console.log(provider instanceof Support.CompatibleModelProvider);Map a custom provider while keeping exact overrides of original fields
Extension · Node.js
import { Support } from '@jangts/agent-core';
const provider = new Support.CompatibleModelProvider({ config: {
baseUrl: 'https://provider.example', apiKey: 'placeholder', model: 'configured-model',
reasoning: { format: 'custom', level: 'medium', map(level) { return { analysis_mode: level }; } },
requestBody: { analysis_mode: 'app-defined' },
} });
console.log(provider instanceof Support.CompatibleModelProvider);import { Support } from '@jangts/agent-core';
const provider = new Support.CompatibleModelProvider({ config: {
baseUrl: 'https://provider.example', apiKey: 'placeholder', model: 'configured-model',
reasoning: { format: 'custom', level: 'medium', map(level) { return { analysis_mode: level }; } },
requestBody: { analysis_mode: 'app-defined' },
} });
console.log(provider instanceof Support.CompatibleModelProvider);