diff --git a/web-ui/html/pptx-wizard.html b/web-ui/html/pptx-wizard.html index d3869c8..8791c2f 100644 --- a/web-ui/html/pptx-wizard.html +++ b/web-ui/html/pptx-wizard.html @@ -331,6 +331,7 @@ body{background:var(--bg);color:var(--text);font-family:'Segoe UI',system-ui,san +
← 번호 클릭으로 이동
1
논문 검색
diff --git a/web-ui/js/pptx/pptx-wizard.js b/web-ui/js/pptx/pptx-wizard.js index e6ae9d8..786e97f 100644 --- a/web-ui/js/pptx/pptx-wizard.js +++ b/web-ui/js/pptx/pptx-wizard.js @@ -741,7 +741,7 @@ async function translateAbstract() { bodyEl.textContent='번역 중...'; try { const msg='다음 영문 의학 논문 초록을 자연스러운 한국어로 번역해주세요:\n\n'+abEn; - const r=await fetch('/api/chat',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json','Accept':'text/event-stream'},body:JSON.stringify({message:msg,sessionId:'translate-abstract',model:'mistral-large-3:675b-cloud'})}); + const r=await fetch('/api/chat',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json','Accept':'text/event-stream'},body:JSON.stringify({message:msg,sessionId:'translate-abstract',...wizModelBody()})}); if(!r.ok) throw new Error('API '+r.status); const reader=r.body.getReader(),dec=new TextDecoder(); let buf='',reply=''; @@ -792,10 +792,31 @@ function splitChunks(text, size) { return chunks; } +// 모델 선택: 비워 두면 서버의 활성 provider 기본 모델을 따른다(모델 이름을 코드에 박지 않는다 — +// provider가 바뀌면 옛 이름이 그대로 API로 가서 실패한다). 선택값은 이 브라우저에만 저장. +const WIZ_MODEL_KEY='pptx_wizard_model'; +function wizModel(){try{return localStorage.getItem(WIZ_MODEL_KEY)||'';}catch{return '';}} +function wizModelBody(){const m=wizModel();return m?{model:m}:{};} +function wizModelChanged(sel){try{if(sel.value)localStorage.setItem(WIZ_MODEL_KEY,sel.value);else localStorage.removeItem(WIZ_MODEL_KEY);}catch{}} +async function loadWizModels(){ + const sel=document.getElementById('wiz-model'); if(!sel)return; + try{ + const pr=await fetch('/api/settings/provider',cr()); const pd=await pr.json(); + const tr=await fetch('/api/models/test',{...jh(),method:'POST',body:JSON.stringify({llm:pd.llm})}); const td=await tr.json(); + const models=(td.models||[]).map(m=>typeof m==='string'?m:(m.name||String(m))); + const mr=await fetch('/api/settings/model',cr()); const md=mr.ok?await mr.json():{}; + const own=wizModel(); + if(own&&!models.includes(own)){try{localStorage.removeItem(WIZ_MODEL_KEY);}catch{}} // provider가 바뀌어 없어진 모델 + const cur=wizModel(); + sel.innerHTML=''+models.map(m=>``).join(''); + }catch{} +} +loadWizModels(); + async function chatStream(msg, sessionId) { const r = await fetch('/api/chat', {method:'POST', credentials:'include', headers:{'Content-Type':'application/json','Accept':'text/event-stream'}, - body: JSON.stringify({message: msg, sessionId, direct: true, model: 'mistral-large-3:675b-cloud', ...(_presenterSkill?{skillContext:_presenterSkill}:{})})}); + body: JSON.stringify({message: msg, sessionId, direct: true, ...wizModelBody(), ...(_presenterSkill?{skillContext:_presenterSkill}:{})})}); if (!r.ok) throw new Error('API ' + r.status); const reader = r.body.getReader(), dec = new TextDecoder(); let buf = '', reply = ''; @@ -1666,7 +1687,7 @@ async function generateOutline() { const prompt=`[PPTX 워크플로 시작]\n요청: ${topic}\nPMCIDs: ${pmcids}\n템플릿: ${tmpl}${skin?'\n배경 스킨: '+skin:''}\n슬라이드 수: ${slides}장\n\n=== 논문 내용 ===\n${contentBlocks.join('\n\n---\n')}\n\n=== 추출된 이미지 ===\n${imgList||'없음'}\n\n위 논문 내용과 이미지를 활용해 슬라이드 아웃라인을 \`\`\`pptx-outline 블록으로 출력해주세요. create_presentation은 아직 호출하지 마세요.`; try{ - const r=await fetch('/api/chat',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json','Accept':'text/event-stream'},body:JSON.stringify({message:prompt,history:[],useTools:true,model:'mistral-large-3:675b-cloud',...(_presenterSkill?{skillContext:_presenterSkill}:{})})}); + const r=await fetch('/api/chat',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json','Accept':'text/event-stream'},body:JSON.stringify({message:prompt,history:[],useTools:true,...wizModelBody(),...(_presenterSkill?{skillContext:_presenterSkill}:{})})}); if(!r.ok) throw new Error('API '+r.status); const reader=r.body.getReader(),dec=new TextDecoder(); let buf='',reply='';