diff --git a/web-ui/html/pptx-wizard.html b/web-ui/html/pptx-wizard.html
index 8791c2f..bdb5ee2 100644
--- a/web-ui/html/pptx-wizard.html
+++ b/web-ui/html/pptx-wizard.html
@@ -376,7 +376,7 @@ body{background:var(--bg);color:var(--text);font-family:'Segoe UI',system-ui,san
π‘ μμΒ·μ½λ¬ΌΒ·μ§λ³μ PubMed Β· 보건μ μ±
/μλ£κ²½μ /λΉκ΅μ°κ΅¬λ OpenAlex + Semantic Β· μμ°μ΄ λ¬Έμ₯μΌλ‘ κ²μνλ©΄ Semantic Β· βvs / versusβλ λΉΌκ³ ν€μλλ§ λ£μΌμΈμ.
β PMCλ±μ¬ β PubMed Centralμ μ λ¬Έ(PDF) μμ. 체ν¬λ°μ€λ‘ μ νν΄ PPTXμ νμ© κ°λ₯.
diff --git a/web-ui/js/pptx/pptx-wizard.js b/web-ui/js/pptx/pptx-wizard.js
index 786e97f..12c8fce 100644
--- a/web-ui/js/pptx/pptx-wizard.js
+++ b/web-ui/js/pptx/pptx-wizard.js
@@ -536,7 +536,7 @@ function goStep(n) {
}
// ββ STEP 1: Search ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-async function doSearch() {
+async function doSearch(extraQueries) {
const q=document.getElementById('qi').value.trim();
const yr=document.getElementById('qy').value;
const sort=document.getElementById('cfg-sort').value;
@@ -550,6 +550,8 @@ async function doSearch() {
document.getElementById('results').innerHTML='
κ²μ μ€...
';
try {
const tasks=[];
+ const qs=[q,...(Array.isArray(extraQueries)?extraQueries:[])];
+ for(const q of qs){
if(usePubmed) tasks.push(
fetch('/api/pubmed/search?q='+encodeURIComponent(q)+'&max=15&sort='+sort+(yr?'&min_year='+yr:''),cr())
.then(r=>r.json()).then(d=>(d.data?.results||[]).map(p=>({...p,_source:'pubmed'})))
@@ -579,6 +581,7 @@ async function doSearch() {
citations:p.citations, is_oa:p.is_oa, oa_url:p.oa_url, abstract:p.abstract,
}))).catch(()=>[])
);
+ }
const results=await Promise.all(tasks);
// λ³ν© + DOI κΈ°μ€ μ€λ³΅ μ κ±° (pubmed μ°μ )
@@ -594,12 +597,42 @@ async function doSearch() {
}
papers=[...papers.filter(p=>p._isUpload), ...merged];
renderPapers();
- setMsg(1,merged.length+'건 κ²μλ¨ ('+[usePubmed&&'PubMed',useOpenalex&&'OpenAlex',useSemantic&&'Semantic',useEuropePmc&&'EuropePMC'].filter(Boolean).join('+')+')','var(--green)');
+ setMsg(1,merged.length+'건 κ²μλ¨'+(qs.length>1?' Β· κ²μμ΄ '+qs.length+'κ°':'')+' ('+[usePubmed&&'PubMed',useOpenalex&&'OpenAlex',useSemantic&&'Semantic',useEuropePmc&&'EuropePMC'].filter(Boolean).join('+')+')','var(--green)');
document.getElementById('search-legend').style.display='';
} catch(e){ setMsg(1,'κ²μ μ€ν¨: '+e.message,'var(--red)'); document.getElementById('results').innerHTML='
'+esc(e.message)+'
'; }
finally{ btn.disabled=false; btn.textContent='π κ²μ'; }
}
+// λ§λ‘ μμ² β λͺ¨λΈμ΄ κ²μμ΄(μλ¬Έ ν€μλ)μ μμ μ°λλ₯Ό μ ν΄ κ°μ κ²μ νλ¦μΌλ‘ λλ¦°λ€.
+async function aiSearch(){
+ const req=document.getElementById('qi').value.trim(); if(!req)return;
+ const btn=document.getElementById('aibtn'); btn.disabled=true; btn.textContent='π€ μκ° μ€...';
+ setMsg(1,'λͺ¨λΈμ΄ κ²μμ΄λ₯Ό μ νλ μ€...','var(--brand2)');
+ try{
+ const prompt='μλ μμ²μ λ§λ νμ λ
Όλ¬Έμ PubMedΒ·OpenAlexμμ μ°ΎμΌλ € νλ€. λꡬλ μ°μ§ λ§κ³ , κ²μμ΄λ§ JSON ν μ€λ‘ λ΅νλΌ.\n'
+ +'νμ: {"queries":["μλ¬Έ κ²μμ΄1","μλ¬Έ κ²μμ΄2","μλ¬Έ κ²μμ΄3"],"min_year":2019}\n'
+ +'κ·μΉ: κ²μμ΄λ μλ¬Έ ν€μλ 2~3κ°(ANDΒ·ORΒ·λκ΄νΈ νκ·Έ μμ΄ λ¨μ΄λ§), μλ‘ κ΄μ μ λ¬λ¦¬ν κ². μμ²μ κΈ°κ°Β·μ΅μ μΈκΈμ΄ μμΌλ©΄ min_yearλ null. JSON μΈ λ€λ₯Έ κΈμ κΈμ§.\n\nμμ²: '+req;
+ const r=await fetch('/api/chat',{method:'POST',credentials:'include',headers:{'Content-Type':'application/json','Accept':'text/event-stream'},
+ body:JSON.stringify({message:prompt,sessionId:'pptx-query-plan',...wizModelBody()})});
+ if(!r.ok) throw new Error('API '+r.status);
+ const reader=r.body.getReader(),dec=new TextDecoder(); let buf='',reply='';
+ while(true){const {done,value}=await reader.read(); if(done)break; buf+=dec.decode(value,{stream:true});
+ const lines=buf.split('\n'); buf=lines.pop();
+ for(const line of lines){ if(!line.startsWith('data: '))continue;
+ try{const ev=JSON.parse(line.slice(6));
+ if((ev.type==='token'||ev.type==='text_delta')&&ev.text) reply+=ev.text;
+ else if(ev.type==='done'&&ev.reply) reply=ev.reply;}catch{} } }
+ const m=reply.match(/\{[\s\S]*\}/); if(!m) throw new Error('κ²μμ΄λ₯Ό λͺ» λ°μμ΅λλ€');
+ const plan=JSON.parse(m[0]);
+ const qs=(plan.queries||[]).map(x=>String(x).trim()).filter(Boolean).slice(0,3);
+ if(!qs.length) throw new Error('κ²μμ΄κ° λΉμ΄ μμ΅λλ€');
+ document.getElementById('qi').value=qs[0];
+ if(plan.min_year) document.getElementById('qy').value=plan.min_year;
+ await doSearch(qs.slice(1));
+ }catch(e){ setMsg(1,'AI κ²μ μ€ν¨: '+e.message,'var(--red)'); }
+ finally{ btn.disabled=false; btn.textContent='π€ AI κ²μ'; }
+}
+
function renderPapers() {
const el=document.getElementById('results');
let searchPapers=papers.filter(p=>!p._isUpload);