Make the backend actually send reasoning_effort

d0ebac37c1b2c591bbffbb79793f8c770410a7ed

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +5 -0Showing whitespace changes
src/endpoints/backends/chat-completions.js+5 -0
@@ -967,6 +967,11 @@ router.post('/generate', jsonParser, function (request, response) {
967967 if (getConfigValue('openai.randomizeUserId', false)) {
968968 bodyParams['user'] = uuidv4();
969969 }
970+
971+ // A few of OpenAIs reasoning models support reasoning effort
972+ if (['o1', 'o3-mini', 'o3-mini-2025-01-31'].includes(request.body.model)) {
973+ bodyParams['reasoning_effort'] = request.body.reasoning_effort;
974+ }
970975 } else if (request.body.chat_completion_source === CHAT_COMPLETION_SOURCES.OPENROUTER) {
971976 apiUrl = 'https://openrouter.ai/api/v1';
972977 apiKey = readSecret(request.user.directories, SECRET_KEYS.OPENROUTER);