Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++
559 B
Raw Blame
export function validateChatImages(images){if(images===undefined)return [];if(!Array.isArray(images)||images.length>4)throw new Error('Attach up to four pictures per message.');return images.map(i=>{if(!i||typeof i.url!=='string'||!/^data:image\/(png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/.test(i.url))throw new Error('Pictures must be attached PNG, JPEG or WebP files.');if(Buffer.byteLength(i.url.split(',')[1],'base64')>6*1024*1024)throw new Error('Choose pictures smaller than 6 MB.');return {url:i.url,name:String(i.name??'Picture').slice(0,256)};});}