ProviderReasoningStrategy
SUPPORT · type · Type contract
How a reasoning level is translated into request fields.
requestBody entries override generated fields, so a host can correct a provider that expects a different shape.
Import
ts
import type { ProviderReasoningStrategy } from '@jangts/agent-core/support';js
/** @typedef {import('@jangts/agent-core/support').ProviderReasoningStrategy} ProviderReasoningStrategy */Other public entry points:@jangts/agent-core, @jangts/agent-core/types, @jangts/agent-core/structs, @jangts/agent-core/support, @jangts/agent-core/support/model.
Definition
Type: ProviderReasoningStrategy
Union branch structure
Optional shapes of ProviderReasoningStrategy: choose one shape; required fields for each branch are listed separately.
Branch 1
| Field | Type | Required | Description |
|---|---|---|---|
level | ProviderReasoningLevel | Required | Read-only. See the type definition and usage context. |
format | "reasoning-effort" | "thinking" | "enable-thinking" | Required | Read-only. See the type definition and usage context. |
map | undefined | Optional | Read-only. See the type definition and usage context. |
budgets | undefined | Optional | Read-only. See the type definition and usage context. |
Branch 2
| Field | Type | Required | Description |
|---|---|---|---|
level | ProviderReasoningLevel | Required | Read-only. See the type definition and usage context. |
format | "thinking-budget" | Required | Read-only. See the type definition and usage context. |
budgets | Readonly<Partial<Record<"low" | "high" | "medium", number>>> | undefined | Optional | Read-only. See the type definition and usage context. |
map | undefined | Optional | Read-only. See the type definition and usage context. |
Branch 3
| Field | Type | Required | Description |
|---|---|---|---|
level | ProviderReasoningLevel | Required | Read-only. See the type definition and usage context. |
format | "custom" | Required | Read-only. See the type definition and usage context. |
map | (level: ProviderReasoningLevel) => Readonly<Record<string, unknown>> | Required | See the type definition and usage context. |
budgets | undefined | Optional | Read-only. See the type definition and usage context. |
Examples
- Reasoning strategies: explicit wire format and natural levels: Support generates reasoning parameters from an explicitly chosen protocol format, preserving exact overrides and custom mappings.
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.
ts
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);js
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
ts
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);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);