Spaces:
Runtime error
Runtime error
updated the opeai key
Browse files
app.py
CHANGED
|
@@ -64,16 +64,14 @@ st.title('Mental Health Assistant :broken_heart:')
|
|
| 64 |
|
| 65 |
# Create a text input box for the OpenAI key
|
| 66 |
openai_key = st.text_input('Enter your OpenAI Key', type='password')
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
if
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
elif key_submit and not openai_key:
|
| 79 |
-
st.error('Please enter your OpenAI key',icon="🚨")
|
|
|
|
| 64 |
|
| 65 |
# Create a text input box for the OpenAI key
|
| 66 |
openai_key = st.text_input('Enter your OpenAI Key', type='password')
|
| 67 |
+
|
| 68 |
+
query = st.text_input('Enter your query', type='default')
|
| 69 |
+
if query and openai_key:
|
| 70 |
+
try:
|
| 71 |
+
with st.spinner('Processing your query...'):
|
| 72 |
+
response = mh_assistant(openai_key,query)
|
| 73 |
+
st.write(response)
|
| 74 |
+
except Exception as e:
|
| 75 |
+
st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
|
| 76 |
+
else:
|
| 77 |
+
st.error('Please enter your OpenAI key and Query both!',icon="🚨")
|
|
|
|
|
|