Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,9 +36,9 @@ if st.button('Ask'):
|
|
36 |
|
37 |
# Display chat history
|
38 |
for message in response.choices[0]['message']['content']:
|
39 |
-
if message
|
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
|
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
|
|
|
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
|