(provider: string, modelId: string)
| 253 | } |
| 254 | |
| 255 | export 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 | } |
no test coverage detected