scvcoder commited on
Commit
0b5cf16
·
verified ·
1 Parent(s): ffc58e0

Auto-clear _last_refs on / and /split page load (page reload starts fresh)

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -126,8 +126,23 @@ def _attach_split_view() -> None:
126
  f'src="{UI_SPACE_URL}"',
127
  )
128
 
129
- # 핸들러 한 개를 /split 와 / 양쪽에 라우팅 — 동일 HTML.
 
130
  async def _split_handler():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  return HTMLResponse(hf_html)
132
 
133
  # /split — 명시적 별칭 (백워드 호환).
 
126
  f'src="{UI_SPACE_URL}"',
127
  )
128
 
129
+ # 핸들러 한 개를 /split 와 / 양쪽에 라우팅 — 동일 HTML + 페이지 진입 시
130
+ # 우측 참고자료 자동 초기화 (이전 세션 잔여 데이터 노출 방지).
131
  async def _split_handler():
132
+ import time as _time
133
+ from kpaa.server import _last_refs
134
+
135
+ _last_refs.update({
136
+ "ts": _time.time(),
137
+ "query": "",
138
+ "intents": [],
139
+ "jo_targets": [],
140
+ "elapsed_ms": 0,
141
+ "excerpts": [],
142
+ "cited_citations": [],
143
+ "llm_excerpt_citations": [],
144
+ "geungeo_indices_in_answer": [],
145
+ })
146
  return HTMLResponse(hf_html)
147
 
148
  # /split — 명시적 별칭 (백워드 호환).