Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -76,7 +76,7 @@ if st.button("Clear Chat"):
|
|
76 |
|
77 |
# Display chat messages from history on app rerun
|
78 |
for message in st.session_state.messages:
|
79 |
-
avatar = "
|
80 |
with st.chat_message(message["role"], avatar=avatar):
|
81 |
st.markdown(message["content"])
|
82 |
|
@@ -91,7 +91,7 @@ def generate_chat_responses(chat_completion) -> Generator[str, None, None]:
|
|
91 |
if prompt := st.chat_input("Enter your prompt here..."):
|
92 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
93 |
|
94 |
-
with st.chat_message("user", avatar="
|
95 |
st.markdown(prompt)
|
96 |
|
97 |
# Fetch response from Groq API
|
@@ -107,7 +107,7 @@ if prompt := st.chat_input("Enter your prompt here..."):
|
|
107 |
)
|
108 |
|
109 |
# Use the generator function with st.write_stream
|
110 |
-
with st.chat_message("assistant", avatar="
|
111 |
chat_responses_generator = generate_chat_responses(chat_completion)
|
112 |
full_response = st.write_stream(chat_responses_generator)
|
113 |
except Exception as e:
|
|
|
76 |
|
77 |
# Display chat messages from history on app rerun
|
78 |
for message in st.session_state.messages:
|
79 |
+
avatar = "🔋" if message["role"] == "assistant" else "🧑💻"
|
80 |
with st.chat_message(message["role"], avatar=avatar):
|
81 |
st.markdown(message["content"])
|
82 |
|
|
|
91 |
if prompt := st.chat_input("Enter your prompt here..."):
|
92 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
93 |
|
94 |
+
with st.chat_message("user", avatar="🧑💻"):
|
95 |
st.markdown(prompt)
|
96 |
|
97 |
# Fetch response from Groq API
|
|
|
107 |
)
|
108 |
|
109 |
# Use the generator function with st.write_stream
|
110 |
+
with st.chat_message("assistant", avatar="🔋"):
|
111 |
chat_responses_generator = generate_chat_responses(chat_completion)
|
112 |
full_response = st.write_stream(chat_responses_generator)
|
113 |
except Exception as e:
|