MistalAI: Add custom stop strings

Closes #3627
This commit is contained in:
Cohee
2025-03-07 11:29:14 +00:00
parent 7de516e5e7
commit 1a52314812
2 changed files with 2 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {