Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -78,12 +78,9 @@ with col2:
|
|
78 |
|
79 |
# Display chat messages from history on app rerun
|
80 |
for message in st.session_state.messages:
|
81 |
-
if
|
82 |
-
|
83 |
-
|
84 |
-
st.markdown(message.content)
|
85 |
-
else:
|
86 |
-
st.warning("Message object does not have the 'role' attribute.")
|
87 |
|
88 |
def generate_chat_responses(chat_completion) -> Generator[str, None, None]:
|
89 |
"""Yield chat response content from the Groq API response."""
|
|
|
78 |
|
79 |
# Display chat messages from history on app rerun
|
80 |
for message in st.session_state.messages:
|
81 |
+
avatar = "🤖" if message["role"] == "assistant" else "🕺"
|
82 |
+
with st.chat_message(message["role"], avatar=avatar):
|
83 |
+
st.markdown(message["content"])
|
|
|
|
|
|
|
84 |
|
85 |
def generate_chat_responses(chat_completion) -> Generator[str, None, None]:
|
86 |
"""Yield chat response content from the Groq API response."""
|