MistalAI: Add custom stop strings Closes #3627

1a52314812538a155cb4a8743f5b65cd5ff285d3

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

2 files changed, +2 -0Showing whitespace changes
public/scripts/openai.js+1 -0
@@ -2072,6 +2072,7 @@ async function sendOpenAIRequest(type, messages, signal) {
20722072
2073 if (isMistral) {2073 if (isMistral) {
2074 generate_data['safe_prompt'] = false; // already defaults to false, but just incase they change that in the future.2074 generate_data['safe_prompt'] = false; // already defaults to false, but just incase they change that in the future.
2075 generate_data['stop'] = getCustomStoppingStrings(); // Mistral shouldn't have limits on stop strings.
2075 }2076 }
20762077
2077 if (isCustom) {2078 if (isCustom) {
src/endpoints/backends/chat-completions.js+1 -0
@@ -586,6 +586,7 @@ async function sendMistralAIRequest(request, response) {
586 'stream': request.body.stream,586 'stream': request.body.stream,
587 'safe_prompt': request.body.safe_prompt,587 'safe_prompt': request.body.safe_prompt,
588 'random_seed': request.body.seed === -1 ? undefined : request.body.seed,588 'random_seed': request.body.seed === -1 ? undefined : request.body.seed,
589 'stop': Array.isArray(request.body.stop) && request.body.stop.length > 0 ? request.body.stop : undefined,
589 };590 };
590591
591 if (Array.isArray(request.body.tools) && request.body.tools.length > 0) {592 if (Array.isArray(request.body.tools) && request.body.tools.length > 0) {