Update app.py
Browse files
app.py
CHANGED
|
@@ -79,7 +79,7 @@ if st.button("Clear Chat"):
|
|
| 79 |
|
| 80 |
# Display chat messages from history on app rerun
|
| 81 |
for message in st.session_state.messages:
|
| 82 |
-
avatar = "
|
| 83 |
with st.chat_message(message["role"], avatar=avatar):
|
| 84 |
st.markdown(message["content"])
|
| 85 |
|
|
@@ -111,7 +111,7 @@ if prompt := st.chat_input("Enter your prompt here..."):
|
|
| 111 |
)
|
| 112 |
|
| 113 |
# Use the generator function with st.write_stream
|
| 114 |
-
with st.chat_message("assistant", avatar="
|
| 115 |
chat_responses_generator = generate_chat_responses(chat_completion)
|
| 116 |
full_response = st.write_stream(chat_responses_generator)
|
| 117 |
except Exception as e:
|
|
|
|
| 79 |
|
| 80 |
# Display chat messages from history on app rerun
|
| 81 |
for message in st.session_state.messages:
|
| 82 |
+
avatar = "π€" if message["role"] == "assistant" else "π"
|
| 83 |
with st.chat_message(message["role"], avatar=avatar):
|
| 84 |
st.markdown(message["content"])
|
| 85 |
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
# Use the generator function with st.write_stream
|
| 114 |
+
with st.chat_message("assistant", avatar="π€"):
|
| 115 |
chat_responses_generator = generate_chat_responses(chat_completion)
|
| 116 |
full_response = st.write_stream(chat_responses_generator)
|
| 117 |
except Exception as e:
|