fix assistant image follow-up routing

This commit is contained in:
Daniel 2026-05-07 23:06:13 +02:00
parent 65661a54c7
commit 4e3e6031d4

View file

@ -915,7 +915,10 @@ import { escapeAttr, escapeHtml, renderAssistantMarkdown, stripSourcesSection }
}
function isImageRequest(text) {
return /\b(generate|create|draw|make|render)\b[\s\S]{0,80}\b(image|picture|illustration|visual|infographic|diagram|flowchart)\b/i.test(text) ||
text = String(text || '').trim();
return /^(image|photo|picture|visual|illustration|diagram|figure|flowchart|infographic)$/i.test(text) ||
/\b(show|see|display|view|image|photo|picture|visual|illustration|diagram|figure)\b/i.test(text) && text.split(/\s+/).length <= 6 ||
/\b(generate|create|draw|make|render)\b[\s\S]{0,80}\b(image|picture|illustration|visual|infographic|diagram|flowchart)\b/i.test(text) ||
/\b(generate|create|draw|make|render)\b[\s\S]{0,80}\b(an?|the)?\s*(algorithm|pathway|poster|teaching visual)\b/i.test(text);
}