ofermend commited on
Commit
22ac629
β€’
1 Parent(s): cb3c324

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.text(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.text(prompt)
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.text(cleaned)
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