restvatikan commited on
Commit
f92fa9a
Β·
verified Β·
1 Parent(s): 889add2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -24,7 +24,7 @@ if not st.session_state.authenticated:
24
  st.stop()
25
 
26
  # --- UI κ΅¬ν˜„ ---
27
- st.title("🦁 ν•œμ–‘λŒ€ν•™κ΅ ν•™μΉ™ 챗봇 (RAG)")
28
  st.caption("GPT-5-mini & Real-time Hybrid Search & Reranking")
29
 
30
  if "messages" not in st.session_state:
@@ -46,7 +46,6 @@ if prompt := st.chat_input("μ§ˆλ¬Έμ„ μž…λ ₯ν•˜μ„Έμš”..."):
46
  st.markdown(prompt)
47
 
48
  with st.chat_message("assistant"):
49
- # μ‹€μ‹œκ°„ μ§„ν–‰ 상황을 보여쀄 μ»¨ν…Œμ΄λ„ˆ (Gemini μŠ€νƒ€μΌ)
50
  status_container = st.status("πŸš€ 처리 쀑...", expanded=True)
51
  answer_placeholder = st.empty()
52
  full_answer = ""
@@ -55,7 +54,7 @@ if prompt := st.chat_input("μ§ˆλ¬Έμ„ μž…λ ₯ν•˜μ„Έμš”..."):
55
  try:
56
  # stream=True둜 μš”μ²­ν•˜μ—¬ ν•œ 쀄씩 λ°›μŒ
57
  response = requests.post(
58
- "http://localhost:8000/chat", # 배포 ν™˜κ²½μ—μ„œλŠ” localhost μ‚¬μš© κ°€λŠ₯ (Docker λ‚΄λΆ€)
59
  json={"query": prompt, "history": []},
60
  stream=True
61
  )
@@ -68,9 +67,8 @@ if prompt := st.chat_input("μ§ˆλ¬Έμ„ μž…λ ₯ν•˜μ„Έμš”..."):
68
  content = data["content"]
69
 
70
  if msg_type == "log":
71
- # λ‘œκ·ΈλŠ” Status μ»¨ν…Œμ΄λ„ˆμ— 기둝 (흐린 글씨 효과 λŒ€μ‹  단계별 ν‘œμ‹œ)
72
  status_container.write(content)
73
- status_container.update(label=content) # ν˜„μž¬ 단계 제λͺ© μ—…λ°μ΄νŠΈ
74
 
75
  elif msg_type == "answer":
76
  # 닡변은 μ‹€μ‹œκ°„ 타이핑 효과
 
24
  st.stop()
25
 
26
  # --- UI κ΅¬ν˜„ ---
27
+ st.title("ν•œμ–‘λŒ€ν•™κ΅ ν•™μΉ™ 챗봇 (RAG)")
28
  st.caption("GPT-5-mini & Real-time Hybrid Search & Reranking")
29
 
30
  if "messages" not in st.session_state:
 
46
  st.markdown(prompt)
47
 
48
  with st.chat_message("assistant"):
 
49
  status_container = st.status("πŸš€ 처리 쀑...", expanded=True)
50
  answer_placeholder = st.empty()
51
  full_answer = ""
 
54
  try:
55
  # stream=True둜 μš”μ²­ν•˜μ—¬ ν•œ 쀄씩 λ°›μŒ
56
  response = requests.post(
57
+ "http://localhost:8000/chat",
58
  json={"query": prompt, "history": []},
59
  stream=True
60
  )
 
67
  content = data["content"]
68
 
69
  if msg_type == "log":
 
70
  status_container.write(content)
71
+ status_container.update(label=content)
72
 
73
  elif msg_type == "answer":
74
  # 닡변은 μ‹€μ‹œκ°„ 타이핑 효과