diff --git a/.gitignore b/.gitignore index 8d592f0..4b3737a 100644 --- a/.gitignore +++ b/.gitignore @@ -162,4 +162,5 @@ cython_debug/ # data store/ -*cookies.txt \ No newline at end of file +*cookies.txt +auth.yaml \ No newline at end of file diff --git a/auth.yaml.example b/auth.yaml.example new file mode 100644 index 0000000..54b76a0 --- /dev/null +++ b/auth.yaml.example @@ -0,0 +1,17 @@ +credentials: + usernames: + jsmith: + email: jsmith@gmail.com + name: John Smith + password: # Placeholder for hashed password of 'abc' + rbriggs: + email: rbriggs@gmail.com + name: Rebecca Briggs + password: # Placeholder for hashed password of 'def' +cookie: + expiry_days: 30 + key: some_signature_key # Must be string + name: some_cookie_name +preauthorized: + emails: + - melsby@gmail.com \ No newline at end of file diff --git a/src/frontend.py b/src/frontend.py index 5919aa7..0d0674c 100644 --- a/src/frontend.py +++ b/src/frontend.py @@ -1,6 +1,6 @@ import streamlit as st - from backend import get_query_engine, init_index +query_engine = get_query_engine(init_index()) st.set_page_config( page_title="Chat with the Streamlit docs, powered by LlamaIndex", @@ -13,9 +13,6 @@ st.info("Alpha Version", icon="📃") -query_engine = get_query_engine(init_index()) - - def get_response(query): with st.spinner(text="Thinking ..."): st.markdown(query_engine.query(query).response) @@ -26,4 +23,3 @@ def get_response(query): submitted = st.form_submit_button("Ask") if submitted: get_response(text) -