mirror of
https://github.com/sune-org/sune.git
synced 2026-10-16 23:27:54 +00:00
Drop unsupported cf: model prefix, fit account settings on small screens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -9,7 +9,7 @@ export const buildBody=()=>{
|
||||
msgs.push({role:'system', content: mPrompt});
|
||||
}
|
||||
|
||||
const modelName=SUNE.model.replace(/^(or:|oai:|g:|cla:|cf:)/,'').replace(/^[^/]*\//,'').replace(/(?::online|:free)+$/,'');
|
||||
const modelName=SUNE.model.replace(/^(or:|oai:|g:|cla:)/,'').replace(/^[^/]*\//,'').replace(/(?::online|:free)+$/,'');
|
||||
const sPrompt = (SUNE.system_prompt || '').trim().replaceAll('{{model_name}}',()=>modelName);
|
||||
if(sPrompt) {
|
||||
msgs.push({role:'system', content: sPrompt});
|
||||
@@ -37,7 +37,7 @@ export const buildBody=()=>{
|
||||
}
|
||||
}
|
||||
|
||||
const b=payloadWithSampling({model:SUNE.model.replace(/^(or:|oai:|g:|cla:|cf:)/,''),messages:msgs,stream:true});
|
||||
const b=payloadWithSampling({model:SUNE.model.replace(/^(or:|oai:|g:|cla:)/,''),messages:msgs,stream:true});
|
||||
b.reasoning={...(SUNE.reasoning_effort&&SUNE.reasoning_effort!=='default'?{effort:SUNE.reasoning_effort}:{}),exclude:!SUNE.include_thoughts};
|
||||
if(SUNE.img_output){b.modalities=['image'];b.image_config={aspect_ratio:SUNE.aspect_ratio||'1:1',image_size:SUNE.image_size||'1K'}}
|
||||
return b
|
||||
@@ -45,8 +45,8 @@ export const buildBody=()=>{
|
||||
|
||||
async function streamORP(body,onDelta,streamId){
|
||||
const {USER,SUNE,state,gid,cacheStore}=window;
|
||||
const model=SUNE.model,provider=model.startsWith('oai:')?'openai':model.startsWith('g:')?'google':model.startsWith('cla:')?'claude':model.startsWith('cf:')?'cloudflare':model.startsWith('or:')?'openrouter':USER.provider;
|
||||
const apiKey=provider==='openai'?USER.apiKeyOpenAI:provider==='google'?USER.apiKeyGoogle:provider==='claude'?USER.apiKeyClaude:provider==='cloudflare'?USER.apiKeyCloudflare:USER.apiKeyOpenRouter;
|
||||
const model=SUNE.model,provider=model.startsWith('oai:')?'openai':model.startsWith('g:')?'google':model.startsWith('cla:')?'claude':model.startsWith('or:')?'openrouter':USER.provider;
|
||||
const apiKey=provider==='openai'?USER.apiKeyOpenAI:provider==='google'?USER.apiKeyGoogle:provider==='claude'?USER.apiKeyClaude:USER.apiKeyOpenRouter;
|
||||
if(!apiKey){onDelta(window.localDemoReply(),true);return {ok:true,rid:streamId||null}}
|
||||
const r={rid:streamId||gid(),seq:-1,done:false,signaled:false,ws:null};
|
||||
await cacheStore.setItem(r.rid,'busy');
|
||||
|
||||
Reference in New Issue
Block a user