Commit
Β·
04383ec
1
Parent(s):
3eecce0
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,18 +1,20 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from chatnoir_api.v1 import search
|
| 3 |
|
| 4 |
-
@st.cache(suppress_st_warning=True, allow_output_mutation=True)
|
| 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="π",
|
| 13 |
layout="centered"
|
| 14 |
)
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
cola, colb, colc = st.columns([5,4,5])
|
| 17 |
with colb:
|
| 18 |
st.image("https://www.chatnoir.eu/static/img/chatnoir.svg")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from chatnoir_api.v1 import search
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
st.set_page_config(
|
| 5 |
page_title="ChatNoir",
|
| 6 |
page_icon="π",
|
| 7 |
layout="centered"
|
| 8 |
)
|
| 9 |
|
| 10 |
+
@st.cache(suppress_st_warning=True, allow_output_mutation=True, show_spinner=False)
|
| 11 |
+
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}:\n{result.snippet.html}"
|
| 16 |
+
|
| 17 |
+
|
| 18 |
cola, colb, colc = st.columns([5,4,5])
|
| 19 |
with colb:
|
| 20 |
st.image("https://www.chatnoir.eu/static/img/chatnoir.svg")
|