MistalAI: Add custom stop strings Closes #3627
| @@ -2072,6 +2072,7 @@ async function sendOpenAIRequest(type, messages, signal) { | |||
| 2072 | 2072 | ||
| 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 | } |
| 2076 | 2077 | ||
| 2077 | if (isCustom) { | 2078 | if (isCustom) { |
| @@ -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 | }; |
| 590 | 591 | ||
| 591 | if (Array.isArray(request.body.tools) && request.body.tools.length > 0) { | 592 | if (Array.isArray(request.body.tools) && request.body.tools.length > 0) { |