Update app.py
Browse files
app.py
CHANGED
|
@@ -320,10 +320,16 @@ def main():
|
|
| 320 |
</div>
|
| 321 |
""", unsafe_allow_html=True)
|
| 322 |
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
st.markdown(f"""
|
| 324 |
<div class="chat-message assistant-message">
|
| 325 |
<strong>🤖 คำตอบ:</strong><br>
|
| 326 |
-
{
|
| 327 |
</div>
|
| 328 |
""", unsafe_allow_html=True)
|
| 329 |
|
|
|
|
| 320 |
</div>
|
| 321 |
""", unsafe_allow_html=True)
|
| 322 |
else:
|
| 323 |
+
# ✅ FIX: Handle both string and dictionary content safely
|
| 324 |
+
if isinstance(content, dict):
|
| 325 |
+
assistant_response = content.get('answer', '❌ ไม่มีข้อมูลคำตอบ')
|
| 326 |
+
else:
|
| 327 |
+
assistant_response = content
|
| 328 |
+
|
| 329 |
st.markdown(f"""
|
| 330 |
<div class="chat-message assistant-message">
|
| 331 |
<strong>🤖 คำตอบ:</strong><br>
|
| 332 |
+
{assistant_response}
|
| 333 |
</div>
|
| 334 |
""", unsafe_allow_html=True)
|
| 335 |
|