fix: increase max_tokens and handle unclosed think blocks for style generation

This commit is contained in:
2026-06-04 08:50:58 +02:00
parent 5dae92f137
commit 0353a5a9af
+2 -2
View File
@@ -210,7 +210,7 @@ async function callProvider(messages, opts = {}, signal) {
}
// Strip <think> blocks generated by reasoning models (like MiniMax-M3 or DeepSeek-R1)
content = content.replace(/<think>[\s\S]*?<\/think>\s*/gi, '').trim();
content = content.replace(/<think>[\s\S]*?(?:<\/think>\s*|$)/gi, '').trim();
return content;
}
@@ -368,7 +368,7 @@ async function handleStyleRandom(req, res) {
{ role: 'system', content: buildStylePrompt(mode, idea) },
{ role: 'user', content: userMsg },
],
{ max_tokens: 120 },
{ max_tokens: 800 },
signal,
);
const style = cleanStyleString(content);