Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,15 @@ print(os.system('ls -l repo_directory/')) # testing purpose
|
|
| 15 |
|
| 16 |
|
| 17 |
# from repo_directory.network18.app import main
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
# from repo_directory.network18.app import main
|
| 18 |
+
if "openai_key" not in st.session_state:
|
| 19 |
+
with st.form("API key"):
|
| 20 |
+
key = st.text_input("OpenAI Key", value="", type="password")
|
| 21 |
+
if st.form_submit_button("Submit"):
|
| 22 |
+
st.session_state.openai_key = key
|
| 23 |
+
openai.api_key = key
|
| 24 |
+
st.session_state.prompt_history = []
|
| 25 |
+
st.success('Saved API key for this session.')
|
| 26 |
+
|
| 27 |
+
if "openai_key" in st.session_state:
|
| 28 |
+
from repo_directory.PersonalityChatbot.app import *
|
| 29 |
+
main()
|