JirasakJo commited on
Commit
69571da
·
verified ·
1 Parent(s): e3bd05f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -338,22 +338,15 @@ def main():
338
 
339
  # Add expanders right after the answer (if additional document references exist)
340
  if isinstance(content, dict) and content.get('documents'):
341
- with st.expander("📚 แสดงข้อมูลอ้างอิง", expanded=True):
 
342
  for i, doc in enumerate(content['documents'], 1):
343
- doc_content = doc.get('content', 'ไม่มีข้อมูล') # Ensure 'content' key exists
344
- doc_source = doc.get('source', 'ไม่ทราบแหล่งที่มา') # Add document source info if available
345
-
346
  st.markdown(f"""
347
- <div style="padding: 1rem; background-color: #F9FAFB; border-radius: 8px; margin: 0.5rem 0;">
348
- <strong>📄 เอกสารที่ {i}:</strong> <br>
349
- <em>🔗 แหล่งที่มา: {doc_source}</em> <br><br>
350
- {doc_content}
351
  </div>
352
  """, unsafe_allow_html=True)
353
- else:
354
- with st.expander("📚 แสดงข้อมูลอ้างอิง", expanded=False):
355
- st.markdown("<em>ไม่มีข้อมูลอ้างอิงสำหรับคำถามนี้</em>", unsafe_allow_html=True)
356
-
357
 
358
  # Input section at the bottom
359
  with st.container():
 
338
 
339
  # Add expanders right after the answer (if additional document references exist)
340
  if isinstance(content, dict) and content.get('documents'):
341
+ # Add expanders right after the answer
342
+ with st.expander("📚 แสดงข้อมูลอ้างอิง", expanded=False):
343
  for i, doc in enumerate(content['documents'], 1):
 
 
 
344
  st.markdown(f"""
345
+ <div style="padding: 1rem; background-color: #000000; border-radius: 8px; margin: 0.5rem 0;">
346
+ <strong>เอกสารที่ {i}:</strong><br>
347
+ {doc.content}
 
348
  </div>
349
  """, unsafe_allow_html=True)
 
 
 
 
350
 
351
  # Input section at the bottom
352
  with st.container():