sonIA / app.py
Davide Fiocco
update openai and streamlit_authenticator compatibility
0068562
raw
history blame contribute delete
647 Bytes
import streamlit as st
import streamlit_authenticator as stauth
from utils import get_answer
authenticator = stauth.Authenticate(
eval(st.secrets["creds"]),
st.secrets["name"],
st.secrets["key"],
int(st.secrets["expiry_days"]),
)
st.title("Le risposte alle tue domande personali")
name, authentication_status, username = authenticator.login()
if authentication_status:
input = st.text_input("Scrivi una domanda in italiano e comparirà la risposta!")
if input:
response = get_answer(input)
st.write(response)
elif authentication_status == False:
st.error("Username/password non sono corretti.")