Make auto (undefined) actually work

266fa5cbf83c7bbcde47c733e5fb27c398f01404

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +2 -2Showing whitespace changes
src/endpoints/backends/chat-completions.js+2 -2
@@ -883,7 +883,7 @@ async function sendXaiRequest(request, response) {
883 bodyParams['stop'] = request.body.stop;883 bodyParams['stop'] = request.body.stop;
884 }884 }
885885
886 if (['grok-3-mini-beta', 'grok-3-mini-fast-beta'].includes(request.body.model)) {886 if (request.body.reasoning_effort && ['grok-3-mini-beta', 'grok-3-mini-fast-beta'].includes(request.body.model)) {
887 bodyParams['reasoning_effort'] = request.body.reasoning_effort === 'high' ? 'high' : 'low';887 bodyParams['reasoning_effort'] = request.body.reasoning_effort === 'high' ? 'high' : 'low';
888 }888 }
889889
@@ -1273,7 +1273,7 @@ router.post('/generate', function (request, response) {
1273 }1273 }
12741274
1275 // A few of OpenAIs reasoning models support reasoning effort1275 // A few of OpenAIs reasoning models support reasoning effort
1276 if ([CHAT_COMPLETION_SOURCES.CUSTOM, CHAT_COMPLETION_SOURCES.OPENAI].includes(request.body.chat_completion_source)) {1276 if (request.body.reasoning_effort && [CHAT_COMPLETION_SOURCES.CUSTOM, CHAT_COMPLETION_SOURCES.OPENAI].includes(request.body.chat_completion_source)) {
1277 if (['o1', 'o3-mini', 'o3-mini-2025-01-31', 'o4-mini', 'o4-mini-2025-04-16', 'o3', 'o3-2025-04-16'].includes(request.body.model)) {1277 if (['o1', 'o3-mini', 'o3-mini-2025-01-31', 'o4-mini', 'o4-mini-2025-04-16', 'o3', 'o3-2025-04-16'].includes(request.body.model)) {
1278 bodyParams['reasoning_effort'] = request.body.reasoning_effort;1278 bodyParams['reasoning_effort'] = request.body.reasoning_effort;
1279 }1279 }