nehalshah commited on
Commit
7d24120
·
verified ·
1 Parent(s): 241cd0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -10,13 +10,18 @@ query = st.text_input('Enter your query', type='default')
10
 
11
  submit = st.button('Submit')
12
 
13
- st.write(openai_key)
14
-
15
-
16
 
17
  if submit:
18
- response = yg_assistant(openai_key,query)
19
- st.write(response)
 
 
 
 
 
 
 
 
20
 
21
 
22
 
 
10
 
11
  submit = st.button('Submit')
12
 
 
 
 
13
 
14
  if submit:
15
+ if query and openai_key:
16
+ try:
17
+ with st.spinner('Processing your query...'):
18
+ response = yg_assistant(openai_key,query)
19
+ st.write(response)
20
+ except Exception as e:
21
+ st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
22
+ else:
23
+ st.error('Please enter your OpenAI key and Query both!',icon="🚨")
24
+
25
 
26
 
27