Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -123,14 +123,14 @@ def launch_bot():
|
|
123 |
# Display chat messages
|
124 |
for message in st.session_state.messages:
|
125 |
with st.chat_message(message["role"], avatar=message["avatar"]):
|
126 |
-
st.
|
127 |
|
128 |
# User-provided prompt
|
129 |
if prompt := st.chat_input():
|
130 |
st.session_state.messages.append({"role": "user", "content": prompt, "avatar": 'π§βπ»'})
|
131 |
with st.chat_message("user", avatar='π§βπ»'):
|
132 |
print_text(f"Starting new question: {prompt}\n", color='green')
|
133 |
-
st.
|
134 |
|
135 |
# Generate a new response if last message is not from assistant
|
136 |
if st.session_state.messages[-1]["role"] != "assistant":
|
@@ -138,7 +138,7 @@ def launch_bot():
|
|
138 |
with st.spinner(st.session_state.thinking_prompt):
|
139 |
res = st.session_state.agent.chat(prompt)
|
140 |
cleaned = re.sub(r'\[\d+\]', '', res.response)
|
141 |
-
st.
|
142 |
message = {"role": "assistant", "content": cleaned, "avatar": 'π€'}
|
143 |
st.session_state.messages.append(message)
|
144 |
|
|
|
123 |
# Display chat messages
|
124 |
for message in st.session_state.messages:
|
125 |
with st.chat_message(message["role"], avatar=message["avatar"]):
|
126 |
+
st.write(message["content"])
|
127 |
|
128 |
# User-provided prompt
|
129 |
if prompt := st.chat_input():
|
130 |
st.session_state.messages.append({"role": "user", "content": prompt, "avatar": 'π§βπ»'})
|
131 |
with st.chat_message("user", avatar='π§βπ»'):
|
132 |
print_text(f"Starting new question: {prompt}\n", color='green')
|
133 |
+
st.write(prompt)
|
134 |
|
135 |
# Generate a new response if last message is not from assistant
|
136 |
if st.session_state.messages[-1]["role"] != "assistant":
|
|
|
138 |
with st.spinner(st.session_state.thinking_prompt):
|
139 |
res = st.session_state.agent.chat(prompt)
|
140 |
cleaned = re.sub(r'\[\d+\]', '', res.response)
|
141 |
+
st.write(cleaned)
|
142 |
message = {"role": "assistant", "content": cleaned, "avatar": 'π€'}
|
143 |
st.session_state.messages.append(message)
|
144 |
|