Skip to content

Commit

Permalink
prepare auth
Browse files Browse the repository at this point in the history
  • Loading branch information
ValMobYKang committed Nov 9, 2023
1 parent 9933be5 commit 6623404
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@ cython_debug/

# data
store/
*cookies.txt
*cookies.txt
auth.yaml
17 changes: 17 additions & 0 deletions auth.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
credentials:
usernames:
jsmith:
email: [email protected]
name: John Smith
password: # Placeholder for hashed password of 'abc'
rbriggs:
email: [email protected]
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:
- [email protected]
6 changes: 1 addition & 5 deletions src/frontend.py
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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)
Expand All @@ -26,4 +23,3 @@ def get_response(query):
submitted = st.form_submit_button("Ask")
if submitted:
get_response(text)

0 comments on commit 6623404

Please sign in to comment.