Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ if uploaded_file and "document_uploaded" not in st.session_state:
|
|
53 |
st.session_state["document_uploaded"] = True
|
54 |
|
55 |
# Chat UI Header
|
56 |
-
st.title("💬
|
57 |
st.divider()
|
58 |
|
59 |
# Display chat history
|
@@ -63,7 +63,8 @@ for message in memory_storage.messages:
|
|
63 |
|
64 |
with st.chat_message(role, avatar=f"data:image/jpeg;base64,{avatar}"):
|
65 |
if role == "assistant":
|
66 |
-
|
|
|
67 |
else:
|
68 |
st.markdown(message.content)
|
69 |
|
@@ -86,6 +87,6 @@ if user_input:
|
|
86 |
|
87 |
memory_storage.add_ai_message(answer)
|
88 |
|
89 |
-
# Display AI response
|
90 |
with st.chat_message("assistant", avatar=f"data:image/jpeg;base64,{ai_avatar}"):
|
91 |
-
st.
|
|
|
53 |
st.session_state["document_uploaded"] = True
|
54 |
|
55 |
# Chat UI Header
|
56 |
+
st.title("💬 AI Chat Assistant")
|
57 |
st.divider()
|
58 |
|
59 |
# Display chat history
|
|
|
63 |
|
64 |
with st.chat_message(role, avatar=f"data:image/jpeg;base64,{avatar}"):
|
65 |
if role == "assistant":
|
66 |
+
# Display AI response with Markdown formatting for a ChatGPT-like feel
|
67 |
+
st.markdown(f"```\n{message.content}\n```")
|
68 |
else:
|
69 |
st.markdown(message.content)
|
70 |
|
|
|
87 |
|
88 |
memory_storage.add_ai_message(answer)
|
89 |
|
90 |
+
# Display AI response in a ChatGPT-like format
|
91 |
with st.chat_message("assistant", avatar=f"data:image/jpeg;base64,{ai_avatar}"):
|
92 |
+
st.markdown(f"```\n{answer.content}\n```")
|