JirasakJo commited on
Commit
2840f69
·
verified ·
1 Parent(s): 6fa1483

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
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
- {content['answer']}
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