MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / getThinkingCompat

Function getThinkingCompat

packages/core/src/ai/thinking.ts:255–288  ·  view source on GitHub ↗
(provider: string, modelId: string)

Source from the content-addressed store, hash-verified

253}
254
255export function getThinkingCompat(provider: string, modelId: string): ThinkingCompat {
256 const type = classifyThinkingType(provider, modelId)
257
258 if (type === 'none') return {}
259
260 // Gemini uses pi-ai's native Google provider; no compat fields needed.
261 if (type === 'gemini') return {}
262
263 if (type === 'qwen' || type === 'hunyuan') {
264 return { thinkingFormat: 'qwen' }
265 }
266
267 if (type === 'deepseek_v4') {
268 return {
269 thinkingFormat: 'deepseek',
270 thinkingLevelMap: { high: 'high', xhigh: 'max', minimal: null, low: null, medium: null },
271 }
272 }
273
274 if (type === 'deepseek_hybrid') {
275 return {
276 thinkingFormat: 'deepseek',
277 thinkingLevelMap: { auto: 'auto', high: 'high', minimal: null, low: null, medium: null, xhigh: null },
278 }
279 }
280
281 // All remaining types use OpenAI-style reasoning_effort.
282 const compat: ThinkingCompat = { supportsReasoningEffort: true }
283 const levelMap = TYPE_LEVEL_MAP[type]
284 if (levelMap) {
285 compat.thinkingLevelMap = levelMap as Partial<Record<ThinkingLevel, string | null>>
286 }
287 return compat
288}

Callers 2

thinking.test.tsFile · 0.90
inferReasoningFunction · 0.90

Calls 1

classifyThinkingTypeFunction · 0.85

Tested by

no test coverage detected