yunuseduran commited on
Commit
5e0b93e
·
verified ·
1 Parent(s): 779c3b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -35,10 +35,10 @@ if st.button('Ask'):
35
  st.experimental_rerun()
36
 
37
  # Display chat history
38
- for message in reversed(st.session_state.chat.history):
39
- if message['role'] == 'user':
40
  st.markdown(f'<div style="text-align: right; background-color: #2F2F2F; padding: 10px; border-radius: 10px; margin: 10px; width: fit-content;">👤 Sen: {message["text"]}</div>', unsafe_allow_html=True)
41
- elif message['role'] == 'model':
42
  st.markdown(f'<div style="text-align: left; background-color: #2E2E2E; padding: 10px; border-radius: 10px; margin: 10px; width: fit-content;">🤖 Bot: {message["text"]}</div>', unsafe_allow_html=True)
43
 
44
  # Handle "Yeni Sohbet" button click
 
35
  st.experimental_rerun()
36
 
37
  # Display chat history
38
+ for message in response.choices[0]['message']['content']:
39
+ if message.role == 'user':
40
  st.markdown(f'<div style="text-align: right; background-color: #2F2F2F; padding: 10px; border-radius: 10px; margin: 10px; width: fit-content;">👤 Sen: {message["text"]}</div>', unsafe_allow_html=True)
41
+ elif message.role == 'model':
42
  st.markdown(f'<div style="text-align: left; background-color: #2E2E2E; padding: 10px; border-radius: 10px; margin: 10px; width: fit-content;">🤖 Bot: {message["text"]}</div>', unsafe_allow_html=True)
43
 
44
  # Handle "Yeni Sohbet" button click