diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 33dc24978..b79783c05 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -2072,6 +2072,7 @@ async function sendOpenAIRequest(type, messages, signal) { if (isMistral) { generate_data['safe_prompt'] = false; // already defaults to false, but just incase they change that in the future. + generate_data['stop'] = getCustomStoppingStrings(); // Mistral shouldn't have limits on stop strings. } if (isCustom) { diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js index 09e062dfb..7a19257f6 100644 --- a/src/endpoints/backends/chat-completions.js +++ b/src/endpoints/backends/chat-completions.js @@ -586,6 +586,7 @@ async function sendMistralAIRequest(request, response) { 'stream': request.body.stream, 'safe_prompt': request.body.safe_prompt, 'random_seed': request.body.seed === -1 ? undefined : request.body.seed, + 'stop': Array.isArray(request.body.stop) && request.body.stop.length > 0 ? request.body.stop : undefined, }; if (Array.isArray(request.body.tools) && request.body.tools.length > 0) {