Feat: Pass quantization to provider params

This commit is contained in:
2025-12-05 17:34:31 -08:00
parent af5f0e52b9
commit ea5076afad

View File

@@ -9,7 +9,7 @@ export const buildBody=()=>{
const b=payloadWithSampling({model:SUNE.model.replace(/^(or:|oai:|g:|cla:|cf:)/,''),messages:msgs,stream:true});
if(SUNE.json_output){let s;try{s=JSON.parse(SUNE.json_schema||'null')}catch{s=null}if(s&&typeof s==='object'&&Object.keys(s).length>0){b.response_format={type:'json_schema',json_schema:s}}else{b.response_format={type:'json_object'}}}
b.reasoning={...(SUNE.reasoning_effort&&SUNE.reasoning_effort!=='default'?{effort:SUNE.reasoning_effort}:{}),exclude:!SUNE.include_thoughts};
if(Array.isArray(SUNE.quantizations)&&SUNE.quantizations.length)b.provider={...(b.provider||{}),quantizations:[...new Set(SUNE.quantizations.map(String))]};
if(Array.isArray(SUNE.quantization)&&SUNE.quantization.length)b.provider={quantizations:SUNE.quantization};
if(SUNE.img_output&&!USER.donor){b.modalities=['text','image'];b.image_config={aspect_ratio:'1:1'}}
return b
}
@@ -80,4 +80,3 @@ export async function streamChat(onDelta,streamId){
}
return await streamORP(body,onDelta,streamId)
}