medmac01 commited on
Commit
05f7916
·
1 Parent(s): 71831c5

solve chat disappearing

Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -242,14 +242,19 @@ def main():
242
  if st.button(f"Double-Check Response", key="google_button"):
243
  search_query = get_search_query(st.session_state['generated'][-1])
244
  retrieved_links = search_url(search_query)
 
 
 
 
 
245
  if retrieved_links:
246
  st.markdown("**Google Search Results:**")
247
  for j, link in enumerate(retrieved_links):
248
  st.markdown(f"{j + 1}. [{link['title']}]({link['link']})")
249
 
250
  # Display Google logo
 
251
  google_logo_url = "https://companieslogo.com/img/orig/GOOG-0ed88f7c.png"
252
- st.image(google_logo_url, width=50, caption="Google Logo")
253
 
254
  if __name__ == "__main__":
255
  main()
 
242
  if st.button(f"Double-Check Response", key="google_button"):
243
  search_query = get_search_query(st.session_state['generated'][-1])
244
  retrieved_links = search_url(search_query)
245
+
246
+ for i in range(len(st.session_state['generated'])):
247
+ message(st.session_state['past'][i], is_user=True, key=str(i) + '_user', logo="https://i.pinimg.com/originals/d5/b2/13/d5b21384ccaaa6f9ef32986f17c50638.png")
248
+ message(st.session_state["generated"][i], key=str(i), logo= "https://emojiisland.com/cdn/shop/products/Robot_Emoji_Icon_7070a254-26f7-4a54-8131-560e38e34c2e_large.png?v=1571606114")
249
+
250
  if retrieved_links:
251
  st.markdown("**Google Search Results:**")
252
  for j, link in enumerate(retrieved_links):
253
  st.markdown(f"{j + 1}. [{link['title']}]({link['link']})")
254
 
255
  # Display Google logo
256
+ st.image(google_logo_url, width=15, caption="Google Logo")
257
  google_logo_url = "https://companieslogo.com/img/orig/GOOG-0ed88f7c.png"
 
258
 
259
  if __name__ == "__main__":
260
  main()