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

added submit btn

Browse files
Files changed (1) hide show
  1. app.py +11 -9
app.py CHANGED
@@ -66,12 +66,14 @@ st.title('Mental Health Assistant :broken_heart:')
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="🚨")
 
 
 
66
  openai_key = st.text_input('Enter your OpenAI Key', type='password')
67
 
68
  query = st.text_input('Enter your query', type='default')
69
+ submit = st.button('Submit')
70
+ if submit:
71
+ if query and openai_key:
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
+ else:
79
+ st.error('Please enter your OpenAI key and Query both!',icon="🚨")