Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,6 +36,38 @@ def get_access_token(code):
|
|
36 |
st.error('Error acquiring token: ' + str(result.get('error_description')))
|
37 |
st.stop()
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
# ๐โโ๏ธ Main application function
|
40 |
def main():
|
41 |
st.title("๐ฆ Simple Streamlit App with MS Graph API")
|
|
|
36 |
st.error('Error acquiring token: ' + str(result.get('error_description')))
|
37 |
st.stop()
|
38 |
|
39 |
+
|
40 |
+
def process_query_parms():
|
41 |
+
# โ๏ธq= Run ArXiv search from query parameters
|
42 |
+
try:
|
43 |
+
query_params = st.query_params
|
44 |
+
query = (query_params.get('q') or query_params.get('query') or [''])
|
45 |
+
if len(query) > 1:
|
46 |
+
#result = search_arxiv(query)
|
47 |
+
#result2 = search_glossary(result)
|
48 |
+
|
49 |
+
filesearch = PromptPrefix + query
|
50 |
+
st.markdown(filesearch)
|
51 |
+
process_text(filesearch)
|
52 |
+
except:
|
53 |
+
st.markdown(' ')
|
54 |
+
|
55 |
+
if 'action' in st.query_params:
|
56 |
+
action = st.query_params()['action'][0] # Get the first (or only) 'action' parameter
|
57 |
+
if action == 'show_message':
|
58 |
+
st.success("Showing a message because 'action=show_message' was found in the URL.")
|
59 |
+
elif action == 'clear':
|
60 |
+
clear_query_params()
|
61 |
+
#st.rerun()
|
62 |
+
|
63 |
+
if 'query' in st.query_params:
|
64 |
+
query = st.query_params['query'][0] # Get the query parameter
|
65 |
+
# Display content or image based on the query
|
66 |
+
display_content_or_image(query)
|
67 |
+
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
# ๐โโ๏ธ Main application function
|
72 |
def main():
|
73 |
st.title("๐ฆ Simple Streamlit App with MS Graph API")
|