(model)
| 236 | } |
| 237 | |
| 238 | if (model.includes('-thinking') || enable_thinking || modelSupportsThinking) { |
| 239 | thinking_config.thinking_enabled = true |
| 240 | } |
| 241 | |
| 242 | if (thinking_budget && !Number.isNaN(Number(thinking_budget)) && Number(thinking_budget) > 0 && Number(thinking_budget) < 131072) { |
| 243 | thinking_config.budget = Number(thinking_budget) |
| 244 | } |
| 245 | |
| 246 | return thinking_config |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * 解析模型名称,移除特殊后缀 |
| 251 | * @param {string} model - 原始模型名称 |
| 252 | * @returns {string} 解析后的模型名称 |
| 253 | */ |
| 254 | const parserModel = async (model) => { |
no test coverage detected