christopher commited on
Commit
3eecce0
β€’
1 Parent(s): 719899a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -5,6 +5,8 @@ from chatnoir_api.v1 import search
5
  def search_chat_noir(key, search_query):
6
  return search(api_key=key, query=search_query)
7
 
 
 
8
  st.set_page_config(
9
  page_title="ChatNoir",
10
  page_icon="🐈",
@@ -29,7 +31,7 @@ with col2:
29
  if button_clicked:
30
  search_results = search_chat_noir(st.secrets["key"], search_query)
31
  for result in search_results[:10]:
32
- st.components.v1.html(result.snippet.html)
33
 
34
  with st.expander("🐈 About", expanded=False):
35
  st.markdown(
 
5
  def search_chat_noir(key, search_query):
6
  return search(api_key=key, query=search_query)
7
 
8
+ def result_string(result):
9
+ return f"{result.title.html}:\n{results.snippet.html}"
10
  st.set_page_config(
11
  page_title="ChatNoir",
12
  page_icon="🐈",
 
31
  if button_clicked:
32
  search_results = search_chat_noir(st.secrets["key"], search_query)
33
  for result in search_results[:10]:
34
+ st.markdown(result_string(result), unsafe_allow_html=True)
35
 
36
  with st.expander("🐈 About", expanded=False):
37
  st.markdown(