christopher commited on
Commit
e4b8bc7
β€’
1 Parent(s): a42feaa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -12,7 +12,7 @@ def search_chat_noir(key, search_query):
12
  return search(api_key=key, query=search_query)
13
 
14
  def result_string(result):
15
- return f"[{result.title.html}]({result.target_uri}):\n{result.snippet.html}\n---\n"
16
 
17
 
18
  cola, colb, colc = st.columns([5,4,5])
@@ -30,10 +30,11 @@ with col2:
30
  button_clicked = st.button("πŸ”Ž")
31
 
32
 
33
- if button_clicked:
34
  search_results = search_chat_noir(st.secrets["key"], search_query)
35
  for result in search_results[:10]:
36
  st.markdown(result_string(result), unsafe_allow_html=True)
 
37
 
38
  with st.expander("🐈 About", expanded=False):
39
  st.markdown(
 
12
  return search(api_key=key, query=search_query)
13
 
14
  def result_string(result):
15
+ return f"[{result.title.html}]({result.target_uri}):\n{result.snippet.html}"
16
 
17
 
18
  cola, colb, colc = st.columns([5,4,5])
 
30
  button_clicked = st.button("πŸ”Ž")
31
 
32
 
33
+ if search_query or button_clicked:
34
  search_results = search_chat_noir(st.secrets["key"], search_query)
35
  for result in search_results[:10]:
36
  st.markdown(result_string(result), unsafe_allow_html=True)
37
+ st.markdown('---')
38
 
39
  with st.expander("🐈 About", expanded=False):
40
  st.markdown(