Update app.py
Browse files
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 |
-
|
|
|
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: #
|
348 |
-
<strong
|
349 |
-
|
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():
|