cryogenic22 commited on
Commit
fc81768
·
verified ·
1 Parent(s): 0120103

Update components/chat.py

Browse files
Files changed (1) hide show
  1. components/chat.py +3 -2
components/chat.py CHANGED
@@ -113,8 +113,9 @@ def display_chat_interface():
113
  })
114
 
115
  if response:
116
- # Clean the response before creating the message
117
- cleaned_response = clean_response_content(response)
 
118
  ai_message = AIMessage(content=cleaned_response)
119
  st.session_state.messages.append(ai_message)
120
  st.rerun()
 
113
  })
114
 
115
  if response:
116
+ # Extract the content and then clean the response
117
+ response_content = response.content
118
+ cleaned_response = clean_response_content(response_content)
119
  ai_message = AIMessage(content=cleaned_response)
120
  st.session_state.messages.append(ai_message)
121
  st.rerun()