Spaces:
Runtime error
Runtime error
fixd openai key
Browse files
app.py
CHANGED
|
@@ -6,9 +6,9 @@ st.title('Mental Health Assistant :broken_heart:')
|
|
| 6 |
|
| 7 |
# Create a text input box for the OpenAI key
|
| 8 |
openai_key = st.text_input('Enter your OpenAI Key', type='password')
|
| 9 |
-
|
| 10 |
# Display the key when the user presses the 'Submit' button
|
| 11 |
-
if
|
| 12 |
query = st.text_input('Enter your query', type='default')
|
| 13 |
if query:
|
| 14 |
try:
|
|
@@ -16,5 +16,5 @@ if st.button('Subimt') and openai_key:
|
|
| 16 |
print("response",response)
|
| 17 |
except Exception as e:
|
| 18 |
st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
|
| 19 |
-
elif
|
| 20 |
st.error('Please enter your OpenAI key',icon="🚨")
|
|
|
|
| 6 |
|
| 7 |
# Create a text input box for the OpenAI key
|
| 8 |
openai_key = st.text_input('Enter your OpenAI Key', type='password')
|
| 9 |
+
key_submit = st.button('Subimt')
|
| 10 |
# Display the key when the user presses the 'Submit' button
|
| 11 |
+
if key_submit and openai_key:
|
| 12 |
query = st.text_input('Enter your query', type='default')
|
| 13 |
if query:
|
| 14 |
try:
|
|
|
|
| 16 |
print("response",response)
|
| 17 |
except Exception as e:
|
| 18 |
st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
|
| 19 |
+
elif key_submit and not openai_key:
|
| 20 |
st.error('Please enter your OpenAI key',icon="🚨")
|