Momal commited on
Commit
7d4126f
·
1 Parent(s): acf6933

updated the opeai key

Browse files
Files changed (1) hide show
  1. app.py +11 -13
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
- key_submit = st.button('Submit')
68
- # Display the key when the user presses the 'Submit' button
69
- if key_submit and openai_key:
70
- query = st.text_input('Enter your query', type='default')
71
- if query:
72
- try:
73
- with st.spinner('Processing your query...'):
74
- response = mh_assistant(openai_key,query)
75
- st.write(response)
76
- except Exception as e:
77
- st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
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="🚨")